C# 获取远程图片
1.C# 获取Internet上的图片
代码:
Random seed = new Random(); System.Net.WebRequest webreq = System.Net.WebRequest.Create("http://192.168.200.200:8050/A001/B%200000001%2001%202007%20001%200001-20070322-5846E2C44EA449FD8490A31D8F47C802/000008.tif?aid=&" + seed.NextDouble()); System.Net.WebResponse webres = webreq.GetResponse(); Stream stream = webres.GetResponseStream(); Image image; image = Image.FromStream(stream); stream.Close(); pictureEdit1.Image = image;//绑定pictureEdit或pictureBox
2.获取远程路径(共享文件夹)上的图片
代码:
Image image = Image.FromFile(@"\\192.168.200.200\jjmm\000008.tif");