StreamWriter.Null 欄位

定義

提供 StreamWriter,但不包含可寫入但無法讀取的備份存放區。

public: static initonly System::IO::StreamWriter ^ Null;
public static readonly System.IO.StreamWriter Null;
 staticval mutable Null : System.IO.StreamWriter
Public Shared ReadOnly Null As StreamWriter 

欄位值

StreamWriter

範例

下列範例示範如何使用 Null 欄位。

if ( sw->Equals( StreamWriter::Null ) )
{
   sw->WriteLine( "The store can be written to, but not read from." );
}
if(sw.Equals(StreamWriter.Null))
{
    sw.WriteLine("The store can be written to, but not read from.");
}
If Sw.Equals(StreamWriter.Null) Then
    Sw.WriteLine("The store can be written to, but not read from.")
End If

備註

Null 來將輸出重新導向至 StreamWriter 不會使用任何作業系統資源的。

StreamWriter.Write 上叫用方法時 Null ,呼叫只會傳回,而且不會實際將任何資料寫入任何備份存放區。

如需一般 i/o 工作的清單,請參閱 一般 i/o工作。

適用於

另請參閱