共用方式為


RealProxy.CreateObjRef(Type) 方法

定義

建立指定物件型別的 ObjRef,並向遠端基礎結構將它註冊為用戶端啟動的物件。

public:
 virtual System::Runtime::Remoting::ObjRef ^ CreateObjRef(Type ^ requestedType);
public virtual System.Runtime.Remoting.ObjRef CreateObjRef (Type requestedType);
[System.Security.SecurityCritical]
public virtual System.Runtime.Remoting.ObjRef CreateObjRef (Type requestedType);
abstract member CreateObjRef : Type -> System.Runtime.Remoting.ObjRef
override this.CreateObjRef : Type -> System.Runtime.Remoting.ObjRef
[<System.Security.SecurityCritical>]
abstract member CreateObjRef : Type -> System.Runtime.Remoting.ObjRef
override this.CreateObjRef : Type -> System.Runtime.Remoting.ObjRef
Public Overridable Function CreateObjRef (requestedType As Type) As ObjRef

參數

requestedType
Type

ObjRef 已建立的物件型別。

傳回

為指定之型別建立的 ObjRef 的新執行個體。

屬性

範例

virtual ObjRef^ CreateObjRef( Type^ ServerType ) override
{
   Console::WriteLine( "CreateObjRef Method Called ..." );
   CustomObjRef ^ myObjRef = gcnew CustomObjRef( myMarshalByRefObject,ServerType );
   myObjRef->URI = myUri;
   return myObjRef;
}
public override ObjRef CreateObjRef(Type ServerType)
{
   Console.WriteLine ("CreateObjRef Method Called ...");
   CustomObjRef myObjRef = new CustomObjRef(myMarshalByRefObject,ServerType);
   myObjRef.URI = myUri ;
   return myObjRef;
}
Public Overrides Function CreateObjRef(ServerType As Type) As ObjRef
   Console.WriteLine("CreateObjRef Method Called ...")
   Dim myObjRef As New CustomObjRef(myMarshalByRefObject, ServerType)
   myObjRef.URI = myUri
   Return myObjRef
End Function 'CreateObjRef

適用於

另請參閱