1 public static string SaveImage(string url, string newfilename)
 2 {
 3       WebClient mywebclient = new WebClient();
 4       try
 5       {
 6           mywebclient.DownloadFile(url, ConfigurationManager.AppSettings["SaveImgPath"] +"/" + newfilename);
 7       }
 8       catch (IOException ex)
 9       {
10           throw new Exception("未找到图片:" + url + "   Message:" + ex.Message);
11       }
12       catch (Exception ex)
13       {
14           throw new Exception("未找到图片:" + url + "   Message:" + ex.Message);
15       }
16       return newfilename;
17 }

 

相关文章:

  • 2022-12-23
  • 2021-07-04
  • 2022-02-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-09
  • 2022-02-12
  • 2021-08-26
  • 2022-12-23
相关资源
相似解决方案