SslStream.CanWrite 属性

定义

获取一个 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( SslStream^ stream )
{
   Console::WriteLine( L"Can read: {0}, write {1}", stream->CanRead, stream->CanWrite );
   Console::WriteLine( L"Can timeout: {0}", stream->CanTimeout );
}
static void DisplayStreamProperties(SslStream stream)
{
   Console.WriteLine("Can read: {0}, write {1}", stream.CanRead, stream.CanWrite);
   Console.WriteLine("Can timeout: {0}", stream.CanTimeout);
}
Private Shared Sub DisplayStreamProperties(stream As SslStream)
    Console.WriteLine("Can read: {0}, write {1}", stream.CanRead, stream.CanWrite)
    Console.WriteLine("Can timeout: {0}", stream.CanTimeout)
End Sub

注解

如果身份验证成功,此属性将返回通过调用 CanWrite 基础流返回的值。

基础流是在创建 类的 SslStream 实例时指定的。

适用于