private Image GetImage(string url)
{
if (string.IsNullOrEmpty(url))
return null;
WebClient webClient = new WebClient();
MemoryStream stream = null;
try
{
byte[] byteImage = webClient.DownloadData(url);
stream = new MemoryStream(byteImage);
Image image = (Image)new Bitmap(stream);
return image;
}
catch
{
return null;
}
finally
{
stream.Close();
webClient.Dispose();
}
}
浙公网安备 33010602011771号