当前位置:K88软件开发文章中心编程语言.NET.NET01 → 文章内容

pictureBox1的Image属性获得图片路径的三种方法

减小字体 增大字体 作者:佚名  来源:翔宇亭IT乐园  发布时间:2018-12-31 11:14:22

:2010-03-03 18:07:00

1.绝对路径
this.pictureBox2.Image=Image.FromFile("E:\\001.jpg"); 

2.相对路径:
Application.StartupPath;  
可以得到程序根目录  
this.pictureBox2.Image=Image.FromFile(Application.StartupPath "\\1.gif"); 

3.获得网络图片的路径
this.pictureBox2.Image= Image.FromStream(System.Net.WebRequest.Create(http://www.k88.net/images/logo.gif).GetResponse().GetResponseStream());



pictureBox1的Image属性获得图片路径的三种方法