C#中pictureBox.Image的获得图片路径的三种方法
1.绝对路径:
this.pictureBox.Image=Image.FromFile("C:\\test.jpg");
2.相对路径:
Application.StartupPath:获取根路径
this.pictureBox.Image=Image.FromFile(Application.StartupPath +"\\test.jpg");
3.获得网络图片的路径
string url="http://img.zcool.cn/community/01635d571ed29832f875a3994c7836.png@900w_1l_2o_100sh.jpg";
this.pictureBox.Image= Image.FromStream(System.Net.WebRequest.Create(url).GetResponse().GetResponseStream());