現在のインスタンスを外部リスナ サービスにフックするかどうかを示すブール値を取得します。
Public Overridable Property WantsToListen As Boolean Implements _ IChannelReceiverHook.WantsToListen
[C#]
public virtual bool WantsToListen {get; set;}
[C++]
public: __property virtual bool get_WantsToListen();public: __property void set_WantsToListen(bool);
[JScript]
public function get WantsToListen() : Boolean;public function set WantsToListen(Boolean);
プロパティ値
IChannelReceiverHook を外部リスナ サービスにフックするかどうかを示すブール値。
実装
IChannelReceiverHook.WantsToListen
使用例
Dim channelWithPort As New _
System.Runtime.Remoting.Channels.Http.HttpChannel(8085)
Dim channelNoPort As New _
System.Runtime.Remoting.Channels.Http.HttpChannel()
' channelWithPort.WantsToListen is false. It is already listening.
If channelWithPort.WantsToListen Then
System.Console.WriteLine("channelWithPort wants to listen.")
Else
System.Console.WriteLine("channelWithPort doesn't want to listen.")
End If
' channelNoPort.WantsToListen is true.
If channelNoPort.WantsToListen Then
System.Console.WriteLine("channelNoPort wants to listen.")
Else
System.Console.WriteLine("channelNoPort doesn't want to listen.")
End If
[C#]
System.Runtime.Remoting.Channels.Http.HttpChannel channelWithPort =
new System.Runtime.Remoting.Channels.Http.HttpChannel(8085);
System.Runtime.Remoting.Channels.Http.HttpChannel channelNoPort =
new System.Runtime.Remoting.Channels.Http.HttpChannel();
// channelWithPort.WantsToListen is false. It is already listening.
if (channelWithPort.WantsToListen) {
System.Console.WriteLine("channelWithPort wants to listen.");
}
else {
System.Console.WriteLine(
"channelWithPort doesn't want to listen.");
}
// channelNoPort.WantsToListen is true.
if (channelNoPort.WantsToListen) {
System.Console.WriteLine("channelNoPort wants to listen.");
}
else {
System.Console.WriteLine(
"channelNoPort doesn't want to listen.");
}
[C++]
Channels::Http::HttpChannel* channelWithPort = new Channels::Http::HttpChannel(8085);
Channels::Http::HttpChannel* channelNoPort = new Channels::Http::HttpChannel();
// channelWithPort.WantsToListen is false. It is already listening.
if (channelWithPort->WantsToListen)
Console::WriteLine(S"channelWithPort wants to listen.");
else
Console::WriteLine(S"channelWithPort doesn't want to listen.");
// channelNoPort.WantsToListen is true.
if (channelNoPort->WantsToListen)
Console::WriteLine(S"channelNoPort wants to listen.");
else
Console::WriteLine(S"channelNoPort doesn't want to listen.");
[JScript] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン をクリックします。
必要条件
プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ
.NET Framework セキュリティ:
- 直前の呼び出し元の完全信頼。このメンバは、部分的に信頼されているコードから使用することはできません。詳細の参照先 : 部分信頼コードからのライブラリの使用
参照
HttpChannel クラス | HttpChannel メンバ | System.Runtime.Remoting.Channels.Http 名前空間