【发布时间】:2017-09-20 19:08:36
【问题描述】:
我收到了这个错误
ReadTimeout = '((System.IO.Stream)(ms)).ReadTimeout' threw an exception of type 'System.InvalidOperationException'.
我的代码是。
byte[] imageBytes = Convert.FromBase64String(img);
MemoryStream ms = new MemoryStream(imageBytes, 0, imageBytes.Length); //Problem generates here//
谢谢..
【问题讨论】:
-
在你指出的那一行没有抛出异常。 ((System.IO.Stream)(ms)).ReadTimeout' 抛出异常...
-
只有调试时才会出现异常吗?如果你观察对象,它会抛出异常,因为
MemoryStream不支持超时,但它不应该影响你的程序(基于你发布的两行代码)。