C#中picture1中的路徑,有以下三種可以使用
VB可以修改一下語法,底下為C#範例
1.絕對路徑
this.pictureBox2.Image=Image.FromFile("D:\\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.pxkt.com/logo.gif).GetResponse().GetResponseStream());
文章標籤
全站熱搜