public static string SaveImage(string url, string newfilename)
{
WebClient mywebclient = new WebClient();
try
{
mywebclient.DownloadFile(url, ConfigurationManager.AppSettings["SaveImgPath"] +"/" + newfilename);
}
catch (IOException ex)
{
throw new Exception("未找到图片:" + url + " Message:" + ex.Message);
}
catch (Exception ex)
{
throw new Exception("未找到图片:" + url + " Message:" + ex.Message);
}
return newfilename;
}
05-29 00:20