如何:创建客户端激活的类型的实例

此代码示例显示如何创建客户端激活的类型的实例,它假设已注册 TcpChannel 以侦听端口 8080。

示例

Dim Object() = {New UrlAttribute("tcp://computername:8080/RemoteObjectApplicationName ")}
' Note that the second parameter (Nothing) specifies that no arguments
' are being passed.
Dim MyRemoteClass As RemoteObjectClass = _
   CType( _
      Activator.CreateInstance(GetType(RemoteObjectClass), Nothing, url), _
      RemoteObjectClass)
object[] url = {new UrlAttribute("tcp://computername:8080/RemoteObjectApplicationName")};
// Note that the second parameter (null) specifies that no arguments
// are being passed.
RemoteObjectClass MyRemoteClass = (RemoteObjectClass)Activator.CreateInstance(
      typeof(RemoteObjectClass),
      null, 
      url
   );

编译代码

此示例要求:

请参见

概念

远程对象的激活
远程应用程序的配置
服务器激活
生存期租约
客户端激活