62,266
社区成员
发帖
与我相关
我的任务
分享
拖个浏览器控件,指定图片地址
private System.Windows.Forms.PictureBox pictureBox1;
public Form1()
{
InitializeComponent();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.pictureBox1.Location = new System.Drawing.Point(12, 53);
this.pictureBox1.Size = new System.Drawing.Size(270, 129);
this.Controls.Add(this.pictureBox1);
WebClient wc = new WebClient();
string file = Application.StartupPath + "\\1.gif";
wc.DownloadFile("http://www.baidu.com/img/baidu_sylogo1.gif", file);
this.pictureBox1.Image = Image.FromFile(file);
}