标签:returns system creat log ima class stat request http
/// <summary> /// 下载远程图片 /// </summary> /// <param name="url"></param> /// <returns></returns> private Image GetImage(string url) { try { HttpWebRequest myrequest = WebRequest.Create(url) as HttpWebRequest; HttpWebResponse resp = (HttpWebResponse)myrequest.GetResponse(); if (resp.StatusCode == HttpStatusCode.OK) { Stream imgstream = resp.GetResponseStream(); return System.Drawing.Image.FromStream(imgstream); } else { return null; } } catch (WebException ex) { return null; } catch (Exception ex) { return null; } }
标签:returns system creat log ima class stat request http
原文地址:http://www.cnblogs.com/testsec/p/6095907.html