MarshalByRefObject.CreateObjRef(Type) 方法

定義

建立包含所有相關資訊的物件,這些資訊是產生用來與遠端物件通訊的所需 Proxy。

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

物件的 Type,新的 ObjRef 將參考這個型別。

傳回

ObjRef

產生 Proxy 時所需要的資訊。

屬性

例外狀況

這個執行個體不是有效的遠端物件。

立即呼叫端沒有基礎結構使用權限。

備註

CreateObjRef方法是由遠端物件建立方法(例如和) AppDomain.CreateInstance 呼叫 AppDomain.CreateInstanceAndUnwrap 。 在大部分情況下,不需要覆寫這個方法。

適用於