问题描述
我正在尝试从 url 下载图像,但出现异常,例如“远程服务器返回错误:(444) 无响应。”
string url = "https://listing-images.homejunction.com/bright/304545918990/photo_20.jpg";
System.Threading.Thread.Sleep(1000);
using (WebClient wc = new WebClient())
{
byte[] byteUrl = wc.DownloadData(url);
Image orgImg = Bitmap.FromStream(new MemoryStream(byteUrl));
Bitmap bmpImage = new Bitmap(orgImg);
Bitmap bmpCrop = bmpImage.Clone(new Rectangle(0,orgImg.Width,orgImg.Height - CropSize),bmpImage.PixelFormat);
MemoryStream memoryStream = new MemoryStream();
bmpCrop.Save(memoryStream,orgImg.RawFormat);
return memoryStream;
}
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)