Share via


CanRead Property

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Gets a value that indicates whether the NetworkStream supports reading.

Namespace:  System.Net.Sockets
Assembly:  System (in System.dll)

Syntax

'Declaration
Public Overrides ReadOnly Property CanRead As Boolean
public override bool CanRead { get; }
public:
virtual property bool CanRead {
    bool get () override;
}
abstract CanRead : bool with get
override CanRead : bool with get
override function get CanRead () : boolean

Property Value

Type: System. . :: . .Boolean
true if data can be read from the stream; otherwise, false. The default value is true.

Remarks

If CanRead is true, NetworkStream allows calls to the Read method. Provide the appropriate FileAccess enumerated value in the constructor to set the readability and writability of the NetworkStream. The CanRead property is set when the NetworkStream is initialized.

.NET Framework Security

See Also

Reference

NetworkStream Class

System.Net.Sockets Namespace