Condividi tramite


Procedura: creare un'istanza di un tipo attivato da client

In questo esempio di codice viene illustrato come creare un'istanza di un tipo attivato da client, con il presupposto che una classe TcpChannel sia stata registrata in modo tale da rimanere in attesa sulla porta 8080.

Esempio

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
   );

Compilazione del codice

L'esempio presenta i seguenti requisiti:

Vedere anche

Concetti

Attivazione di oggetti remoti
Configurazione di applicazioni remote
Attivazione da server
Lease di durata
Attivazione da client