日期:2014-05-18  浏览次数:20824 次

WinForms中下载图片问题
private void btnDownload_Click(object sender, EventArgs e)
  {
  try
  {
  WebClient webClient = new WebClient();
  webClient.DownloadFile("http://image.baidu.com/i?ct=503316480&z=1&tn=baiduimagedetail&word=%BA%A3%B6%FB%D0%D6%B5%DC%2Epng&in=22383&cl=2&cm=1&sc=0&lm=-1&pn=3&rn=1&di=2063631080&ln=10&fr=", "100_100_162938.png");
  picShow.Image = Image.FromFile("100_100_162938.png");
  }
  catch (Exception ex)
  {
   
  MessageBox.Show(ex.ToString());
  }
  }

结果显示内存不足,请教各位高手

------解决方案--------------------
代码没问题,但是那个图片链接无效
C# code

System.Net.WebClient wc = new WebClient();
            wc.DownloadFile("http://csdnimg.cn/bbs/t/5/i/pic_logo.gif", "100_100_162938.png");
            picShow.Image = Image.FromFile("100_100_162938.png");