我正在尝试将 responseStream 读取到最后,并在 br.ReadBytes 行中收到错误“不支持指定的方法”。我究竟做错了什么?WebResponse imageResponse = imageRequest.GetResponse();Stream responseStream = imageResponse.GetResponseStream();using (BinaryReader br = new BinaryReader(responseStream)){ imageBytes = br.ReadBytes((int)responseStream.Length); br.Close();}
1 回答

ITMISS
TA贡献1871条经验 获得超8个赞
我收到错误:NotSupportedException:此流不支持查找操作。
假设您想要一个字节数组,为什么不让获取图像变得更容易:
byte[] imageBytes
using (var webClient = new WebClient()) {
imageBytes = webClient.DownloadData("http://yourimage");
}
- 1 回答
- 0 关注
- 152 浏览
添加回答
举报
0/150
提交
取消