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://baidu.com/aaa.jpg";
this.pictureBox.Image= Image.FromStream(System.Net.WebRequest.Create(url).GetResponse().GetResponseStream());
查看更多关于在C#开发时pictureBox控件获得图片路径的三种方法的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://www.haodehen.cn/did253151