NegotiateStream.CanWrite 속성
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
기본 스트림이 쓰기 가능한지를 나타내는 Boolean 값을 가져옵니다.
public:
virtual property bool CanWrite { bool get(); };
public override bool CanWrite { get; }
member this.CanWrite : bool
Public Overrides ReadOnly Property CanWrite As Boolean
속성 값
인증이 수행되고 내부 스트림에 쓸 수 있으면 true
이고, 그렇지 않으면 false
입니다.
예제
다음 코드 예제에서는이 속성의 값을 표시 합니다.
static void DisplayStreamProperties(NegotiateStream stream)
{
Console.WriteLine("Can read: {0}", stream.CanRead);
Console.WriteLine("Can write: {0}", stream.CanWrite);
Console.WriteLine("Can seek: {0}", stream.CanSeek);
try
{
// If the underlying stream supports it, display the length.
Console.WriteLine("Length: {0}", stream.Length);
} catch (NotSupportedException)
{
Console.WriteLine("Cannot get the length of the underlying stream.");
}
if (stream.CanTimeout)
{
Console.WriteLine("Read time-out: {0}", stream.ReadTimeout);
Console.WriteLine("Write time-out: {0}", stream.WriteTimeout);
}
}
설명
인증에 성공하면 이 속성은 기본 스트림에서 속성을 호출하여 CanWrite 반환된 값을 반환합니다. 기본 스트림은 클래스의 NegotiateStream instance 만들 때 지정됩니다.