XmlTextWriter.BaseStream 属性

定义

获取基础流对象。Gets the underlying stream object.

public:
 property System::IO::Stream ^ BaseStream { System::IO::Stream ^ get(); };
public System.IO.Stream? BaseStream { get; }
public System.IO.Stream BaseStream { get; }
member this.BaseStream : System.IO.Stream
Public ReadOnly Property BaseStream As Stream

属性值

Stream

XmlTextWriter 正在向其写入的流;如果 null 是使用不从 TextWriter 类继承的 StreamWriter 构造的,则为 XmlTextWriterThe stream to which the XmlTextWriter is writing or null if the XmlTextWriter was constructed using a TextWriter that does not inherit from the StreamWriter class.

注解

备注

从 .NET Framework 2.0 开始,我们建议 XmlWriter 使用 XmlWriter.Create 方法和类创建实例, XmlWriterSettings 以利用新功能。Starting with the .NET Framework 2.0, we recommend that you create XmlWriter instances by using the XmlWriter.Create method and the XmlWriterSettings class to take advantage of new functionality.

如果编写器是使用 TextWriter 派生自类的的构造的 StreamWriter ,则此属性等效于 StreamWriter.BaseStream 属性。If the writer was constructed using a TextWriter that is derived from the StreamWriter class, this property is equivalent to the StreamWriter.BaseStream property. 如果编写器是使用构造的 Stream ,则此属性返回 Stream 传递给构造函数的。If the writer was constructed using a Stream, this property returns the Stream passed to the constructor. 如果编写器是使用文件名构造的,则此属性返回 Stream 表示该文件的。If the writer was constructed using a file name, this property returns the Stream representing the file.

适用于