NegotiateStream.Read メソッド
アセンブリ: System (system.dll 内)

Public Overrides Function Read ( _ buffer As Byte(), _ offset As Integer, _ count As Integer _ ) As Integer
Dim instance As NegotiateStream Dim buffer As Byte() Dim offset As Integer Dim count As Integer Dim returnValue As Integer returnValue = instance.Read(buffer, offset, count)
戻り値
基になるストリームから読み取るバイト数を指定する Int32 値。読み取るデータがこれ以上存在しない場合は 0 を返します。


このメソッドは、count で指定した最大バイトを現在のストリームから読み取り、buffer 内の offset で始まる位置に格納します。
このメソッドは、正常に認証されるまで呼び出すことはできません。認証するには、AuthenticateAsClient、BeginAuthenticateAsClient、AuthenticateAsServer、または BeginAuthenticateAsServer のいずれかのメソッドを呼び出します。

NegotiateStream から読み取るコード例を次に示します。
public static void AuthenticateClient(TcpClient clientRequest) { NetworkStream stream = clientRequest.GetStream(); // Create the NegotiateStream. NegotiateStream authStream = new NegotiateStream(stream, false); // Perform the server side of the authentication. authStream.AuthenticateAsServer(); // Display properties of the authenticated client. IIdentity id = authStream.RemoteIdentity; Console.WriteLine("{0} was authenticated using {1}.", id.Name, id.AuthenticationType ); // Read a message from the client. byte [] buffer = new byte[2048]; int charLength = authStream.Read(buffer, 0, buffer.Length); string messageData = new String(Encoding.UTF8.GetChars(buffer, 0, buffer.Length)); Console.WriteLine("READ {0}", messageData); // Finished with the current client. authStream.Close(); // Close the client connection. clientRequest.Close(); }

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
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からNegotiateStream.Read メソッドを検索する場合は、下記のリンクをクリックしてください。

- NegotiateStream.Read メソッドのページへのリンク