NegotiateStream コンストラクタとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > NegotiateStream コンストラクタの意味・解説 

NegotiateStream コンストラクタ (Stream, Boolean)

メモ : このコンストラクタは、.NET Framework version 2.0新しく追加されたものです。

指定した Streamストリーム閉じ動作使用してNegotiateStream クラス新しインスタンス初期化します。

名前空間: System.Net.Security
アセンブリ: System (system.dll 内)
構文構文

Public Sub New ( _
    innerStream As Stream, _
    leaveInnerStreamOpen As Boolean _
)
Dim innerStream As Stream
Dim leaveInnerStreamOpen As Boolean

Dim instance As New NegotiateStream(innerStream,
 leaveInnerStreamOpen)
public NegotiateStream (
    Stream innerStream,
    bool leaveInnerStreamOpen
)
public:
NegotiateStream (
    Stream^ innerStream, 
    bool leaveInnerStreamOpen
)
public NegotiateStream (
    Stream innerStream, 
    boolean leaveInnerStreamOpen
)
public function NegotiateStream (
    innerStream : Stream, 
    leaveInnerStreamOpen : boolean
)

パラメータ

innerStream

NegotiateStream がデータの送受信使用する Stream オブジェクト

leaveInnerStreamOpen

この NegotiateStream閉じても、innerstream影響受けないことを示す場合true。この NegotiateStream閉じると、innerStream閉じられることを示す場合false詳細については「解説」を参照してください

例外例外
例外種類条件

ArgumentNullException

innerStreamnull 参照 (Visual Basic では Nothing) です。

または

innerStreamNull等価です。

解説解説

leaveStreamOpen パラメータtrue指定すると、NegotiateStream閉じてinnerStream ストリームには影響しません。innerStream不要になった場合は、明示的に閉じる必要があります

使用例使用例

このコンストラクタ実際に呼び出すコード例次に示します。このコード例は、NegotiateStream クラストピック取り上げているコード例一部分です。

// Establish the remote endpoint for the socket.
// For this example, use the local machine.
IPHostEntry ipHostInfo = Dns.GetHostEntry("localhost");
IPAddress ipAddress = ipHostInfo.AddressList[0];
// Client and server use port 11000. 
IPEndPoint remoteEP = new IPEndPoint(ipAddress, 11000);
// Create a TCP/IP socket.
client = new TcpClient();
// Connect the socket to the remote endpoint.
client.Connect(remoteEP);
Console.WriteLine("Client connected to {0}.", remoteEP.ToString());
// Ensure the client does not close when there is 
// still data to be sent to the server.
client.LingerState = (new LingerOption(true,
 0));
// Request authentication.
NetworkStream clientStream = client.GetStream();
NegotiateStream authStream = new NegotiateStream(clientStream,
 false); 
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
NegotiateStream クラス
NegotiateStream メンバ
System.Net.Security 名前空間

NegotiateStream コンストラクタ

NegotiateStream クラス新しインスタンス初期化します。

ユーザー指定するストリームNegotiateStream閉じないようにするには、NegotiateStream(Stream,Boolean) コンストラクタ使用します


オーバーロードの一覧オーバーロードの一覧
参照参照

関連項目

NegotiateStream クラス
NegotiateStream メンバ
System.Net.Security 名前空間

NegotiateStream コンストラクタ (Stream)

メモ : このコンストラクタは、.NET Framework version 2.0新しく追加されたものです。

Stream指定してNegotiateStream クラス新しインスタンス初期化します。

名前空間: System.Net.Security
アセンブリ: System (system.dll 内)
構文構文

Public Sub New ( _
    innerStream As Stream _
)
Dim innerStream As Stream

Dim instance As New NegotiateStream(innerStream)
public NegotiateStream (
    Stream innerStream
)
public:
NegotiateStream (
    Stream^ innerStream
)
public NegotiateStream (
    Stream innerStream
)
public function NegotiateStream (
    innerStream : Stream
)

パラメータ

innerStream

NegotiateStream がデータの送受信使用する Stream オブジェクト

使用例使用例

このコンストラクタ実際に呼び出すコード例次に示します

 // Establish the remote endpoint for the socket.
 // For this example, use the local machine.
 IPHostEntry ipHostInfo = Dns.GetHostEntry(Dns.GetHostName());
 IPAddress ipAddress = ipHostInfo.AddressList[0];
 // Client and server use port 11000. 
 IPEndPoint remoteEP = new IPEndPoint(ipAddress,11000);
 // Create a TCP/IP socket.
TcpClient client = new TcpClient();
 // Connect the socket to the remote endpoint.
 client.Connect(remoteEP);
 Console.WriteLine("Client connected to {0}.",
     remoteEP.ToString());
 // Ensure the client does not close when there is 
 // still data to be sent to the server.
 client.LingerState = (new LingerOption(true
,0));
 // Request authentication.
 NetworkStream clientStream = client.GetStream();
 NegotiateStream authStream = new NegotiateStream(clientStream);
 
 // Request authentication for the client only (no mutual authentication).
 // Authenicate using the client's default credetials.
 // Permit the server to impersonate the client to access resources
 on the server only.
 // Request that data be transmitted using encryption and data signing.
 authStream.AuthenticateAsClient(
      (NetworkCredential) CredentialCache.DefaultCredentials, 
      "",
      ProtectionLevel.EncryptAndSign,
      TokenImpersonationLevel.Impersonation);
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
NegotiateStream クラス
NegotiateStream メンバ
System.Net.Security 名前空間



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「NegotiateStream コンストラクタ」の関連用語

NegotiateStream コンストラクタのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



NegotiateStream コンストラクタのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS