다음을 통해 공유


방법: 클라이언트 활성 형식의 인스턴스 만들기

이 코드 예는 클라이언트 활성 형식의 인스턴스를 만드는 방법을 보여 줍니다. 이 예에서는 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
   );

코드 컴파일

이 예에서는 다음 사항이 필요합니다.

참고 항목

개념

원격 개체의 활성화
원격 응용 프로그램의 구성
서버 활성화
수명 임대
클라이언트 활성화