This documentation is archived and is not being maintained.

SslStream.CanWrite Property

Gets a Boolean value that indicates whether the underlying stream is writable.

Namespace: System.Net.Security
Assembly: System (in system.dll)

public override bool CanWrite { get; }
/** @property */
public boolean get_CanWrite ()

public override function get CanWrite () : boolean

Not applicable.

Property Value

true if authentication has occurred and the underlying stream is writable; otherwise false.

If successful authentication has occurred, this property returns the value returned by invoking CanWrite on the underlying stream.

The underlying stream is specified when you create an instance of the SslStream class.

The following code example demonstrates displaying the value of this property.

static void DisplayStreamProperties(SslStream stream)
{
   Console.WriteLine("Can read: {0}, write {1}", stream.CanRead, stream.CanWrite);
   Console.WriteLine("Can timeout: {0}", stream.CanTimeout);
}

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0
Show: