请教一个问题,我通过语句设置image如下:
private void menuItem5_Click(object sender, System.EventArgs e)
{
this.pictureBox1.Image=System.Drawing.Image.FromFile("http://mrtg.swjtu.edu.cn/wlzx01- day.png");
}但是运行时候,提示我不支持URL,怎样该啊??但是如果通过属性栏设置imgae对象,输入url就可以,郁闷了
private void menuItem5_Click(object sender, System.EventArgs e)
{
this.pictureBox1.Image=System.Drawing.Image.FromFile("http://mrtg.swjtu.edu.cn/wlzx01- day.png");
}但是运行时候,提示我不支持URL,怎样该啊??但是如果通过属性栏设置imgae对象,输入url就可以,郁闷了
byte[] bytes = w.DownloadData("http://mrtg.swjtu.edu.cn/wlzx01- day.png");
System.IO.MemoryStream ms = new System.IO.MemoryStream(bytes); pictureBox1.Image = Image.FromStream(ms);