Error “This stream does not support seek operations” in C#

后端 未结 7 757
梦毁少年i
梦毁少年i 2020-12-01 07:36

I\'m trying to get an image from an url using a byte stream. But i get this error message:

This stream does not support seek operations.<

相关标签:
7条回答
  • 2020-12-01 07:55

    If the server doesn't send a length specification in the HTTP header, the stream size is unknown, so you get the error when trying to use the Length property.

    Read the stream in smaller chunks, until you reach the end of the stream.

    0 讨论(0)
提交回复
热议问题