C# pictureBox.Image获得图片的三种方法
1 1.绝对路径: 2 this.pictureBox.Image=Image.FromFile("C:\\test.jpg"); 3 4 2.相对路径: 5 Application.StartupPath; 6 可以得到程序根目录 7 this.pictureBox.Image=Image.FromFile(Application.StartupPath "\\test.jpg"); 8 9 3.获得网络图片的路径 10 string url="http://img.zcool.cn/community/01635d571ed29832f875a3994c7836.png@900w_1l_2o_100sh.jpg"; 11 this.pictureBox.Image= Image.FromStream(System.Net.WebRequest.Create(url).GetResponse().GetResponseStream());