ChannelServices.RegisterChannel 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
| 名称 | 说明 |
|---|---|
| RegisterChannel(IChannel) |
已过时.
向通道服务注册通道。 RegisterChannel(IChannel) 已过时。 请改用 RegisterChannel(IChannel, Boolean)。 |
| RegisterChannel(IChannel, Boolean) |
向通道服务注册通道。 |
RegisterChannel(IChannel)
注意
Use System.Runtime.Remoting.ChannelServices.RegisterChannel(IChannel chnl, bool ensureSecurity) instead.
向通道服务注册通道。 RegisterChannel(IChannel) 已过时。 请改用 RegisterChannel(IChannel, Boolean)。
public:
static void RegisterChannel(System::Runtime::Remoting::Channels::IChannel ^ chnl);
public static void RegisterChannel(System.Runtime.Remoting.Channels.IChannel chnl);
[System.Obsolete("Use System.Runtime.Remoting.ChannelServices.RegisterChannel(IChannel chnl, bool ensureSecurity) instead.", false)]
public static void RegisterChannel(System.Runtime.Remoting.Channels.IChannel chnl);
static member RegisterChannel : System.Runtime.Remoting.Channels.IChannel -> unit
[<System.Obsolete("Use System.Runtime.Remoting.ChannelServices.RegisterChannel(IChannel chnl, bool ensureSecurity) instead.", false)>]
static member RegisterChannel : System.Runtime.Remoting.Channels.IChannel -> unit
Public Shared Sub RegisterChannel (chnl As IChannel)
参数
- chnl
- IChannel
要注册的通道。
- 属性
例外
参数 chnl 为 null.
通道已注册。
调用堆栈中至少有一个更高的调用方无权配置远程处理类型和通道。
注解
该方法 RegisterChannel 从通道对象中 IChannel 获取接口。 通道必须是唯一的 ChannelName ,或者通道必须是匿名的。 如果IChannel.ChannelName通道设置为任一或nullEmpty通过使用配置属性,则通道是匿名的name。
不能在一个名称中注册两个 AppDomain同名的通道。 默认情况下,名称 HttpChannel 为“http”,名称 TcpChannel 为“tcp”。因此,如果要注册同一类型的两个通道,则必须通过配置属性为其中一个通道指定不同的名称。
有关通道配置属性的详细信息,请参阅 HttpChannel。
适用于
RegisterChannel(IChannel, Boolean)
向通道服务注册通道。
public:
static void RegisterChannel(System::Runtime::Remoting::Channels::IChannel ^ chnl, bool ensureSecurity);
public static void RegisterChannel(System.Runtime.Remoting.Channels.IChannel chnl, bool ensureSecurity);
static member RegisterChannel : System.Runtime.Remoting.Channels.IChannel * bool -> unit
Public Shared Sub RegisterChannel (chnl As IChannel, ensureSecurity As Boolean)
参数
- chnl
- IChannel
要注册的通道。
- ensureSecurity
- Boolean
true 确保启用安全性;否则 false。 将值设置为 false 不影响 TCP 或 IPC 通道上的安全设置。
例外
参数 chnl 为 null.
通道已注册。
调用堆栈中至少有一个更高的调用方无权配置远程处理类型和通道。
不支持 HttpServerChannel。 如果需要安全的 HTTP 通道,请使用 Internet Information Services (IIS) 托管服务。
注解
该方法 RegisterChannel(IChannel, Boolean) 从通道对象接收 IChannel 接口。 通道必须是唯一的 ChannelName ,或者通道必须是匿名的。 如果IChannel.ChannelName通道设置为任一或nullEmpty通过使用配置属性,则通道是匿名的name。
不能在一个名称中注册两个 AppDomain同名的通道。 默认情况下,a HttpChannel 的名称为“http”,名称 TcpChannel 为“tcp”。 因此,如果要注册同一类型的两个通道,则必须通过配置属性为其中一个通道指定不同的名称。
如果参数 ensureSecurity 设置为 true,远程处理系统将确定通道是否实现 ISecurableChannel,如果是,则启用加密和数字签名。 如果通道未实现 ISecurableChannel,则会引发异常。
注释
设置为ensureSecurity在所有平台上引发通道RemotingExceptionHttpServerChannel。true 如果要使用安全的 http 通道,则必须在 IIS 中托管服务。