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");

  

posted @ 2013-02-01 15:21  艾尼路  阅读(7620)  评论(1编辑  收藏  举报