阅读背景:

在C#中,为什么我不能将StringReader传递给带有Stream参数的方法?

来源:互联网 

In .net 4 and C#. I've implemented a static method to deserialize an XML stream into an object. This is only one xml format going into one object, so I'm not trying to do anything fancy with that. Since I can get this XML content in a variety of ways, I thought I'd make the parameter passed to the static method a Stream object. I'd thought that it would then take any object derived from base class Stream -- like FileStream, MemoryStream, StringReader, etc. In .net 4 and C#. I've implemented a static met




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: