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 

필드 값

예제

다음 예제에서는 필드를 사용하는 방법을 보여 줍니다 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 작업을 참조하세요.

적용 대상

추가 정보