第一种方法是下载到本地来,再显示
System.Net.WebClient WC = new System.Net.WebClient();
WC.DownloadFile("http://www.baidu.com/img/baidu_sylogo1.gif", "C:\\3.gif");
picture1.Image = System.Drawing.Image.FromFile("C:\\3.gif");
第二种方法是获取STREAM,再显示
System.Net.WebRequest req = System.Net.WebRequest.Create("http://www.baidu.com/img/baidu_sylogo1.gif");
System.IO.Stream str = req.GetResponse().GetResponseStream();
picture1.Image = Image.FromStream(str); |