共用方式為


如何建立用戶端啟動型別的執行個體

這個程式碼範例顯示如何建立用戶端啟動型別的執行個體,假設已將 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
   );

編譯程式碼

這個範例需要:

請參閱

概念

遠端物件的啟動
遠端應用程式組態
伺服器啟動
存留使用期
用戶端啟動