NetworkStream.Writeable プロパティ
アセンブリ: System (system.dll 内)

/** @property */ protected boolean get_Writeable () /** @property */ protected void set_Writeable (boolean value)
ストリームにデータを書き込むことができる場合は true。それ以外の場合は false。既定値は true です。

Writeable プロパティを使用するには、NetworkStream から派生させる必要があります。Writeable が true の場合は、NetworkStream で Write メソッドを呼び出すことができます。また、パブリックにアクセス可能な CanWrite プロパティを調べて、NetworkStream が書き込み可能かどうかを確認することもできます。

NetworkStream が書き込み可能かどうかを Writeable プロパティをチェックして確認する CanCommunicate プロパティのコード例を次に示します。
Public Class MyNetworkStream_Sub_Class Inherits NetworkStream Public Sub New(socket As Socket, ownsSocket As Boolean) MyBase.New(socket, ownsSocket) End Sub 'New ' Suppose you wanted a property for determining if Socket is connected. You can use ' the protected method 'Socket' to return underlying Socket. Public ReadOnly Property Connected() As Boolean Get Return Me.Socket.Connected End Get End Property ' You could also use public NetworkStream methods 'CanRead' and 'CanWrite'. Public ReadOnly Property CanCommunicate() As Boolean Get If Not Me.Readable Or Not Me.Writeable Then Return False Else Return True End If End Get End Property Public Shared Sub DoSomethingSignificant() End Sub 'DoSomethingSignificant ' Do something significant in here
using System; using System.Net; using System.Net.Sockets; public class MyNetworkStream_Sub_Class : NetworkStream { public MyNetworkStream_Sub_Class(Socket socket, bool ownsSocket) : base(socket, ownsSocket) { } // You can use the Socket method to examine the underlying Socket. public bool Connected { get { return this.Socket.Connected; } } public bool CanCommunicate { get { if (!this.Readable | !this.Writeable) { return false; } else { return true; } } }
import System.*; import System.Net.*; import System.Net.Sockets.*; public class MyNetworkStreamSubClass extends NetworkStream { public MyNetworkStreamSubClass(Socket socket, boolean ownsSocket) { super(socket, ownsSocket); } //MyNetworkStreamSubClass // You can use the Socket method to examine the underlying Socket. /** @property */ public boolean get_Connected() { return this.get_Socket().get_Connected(); } //get_Connected /** @property */ public boolean get_CanCommunicate() { if (!(this.get_Readable()) | !(this.get_Writeable())) { return false; } else { return true; } } //get_CanCommunicate

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からNetworkStream.Writeable プロパティを検索する場合は、下記のリンクをクリックしてください。

- NetworkStream.Writeable プロパティのページへのリンク