This documentation is archived and is not being maintained.

SslStream.CanRead Property

Note: This property is new in the .NET Framework version 2.0.

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

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

public override bool CanRead { get; }
/** @property */
public boolean get_CanRead ()

public override function get CanRead () : boolean

Property Value

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

If successful authentication has occurred, this property returns the value returned by invoking CanRead 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 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 .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0
Show: