MarshalByRefObject.CreateObjRef(Type) MarshalByRefObject.CreateObjRef(Type) MarshalByRefObject.CreateObjRef(Type) MarshalByRefObject.CreateObjRef(Type) Method

定義

建立包含所有相關資訊的物件,這些資訊是產生用來與遠端物件通訊的所需 Proxy。Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.

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
Public Overridable Function CreateObjRef (requestedType As Type) As ObjRef

參數

requestedType
Type Type Type Type

物件的 Type,新的 ObjRef 將參考這個型別。The Type of the object that the new ObjRef will reference.

傳回

產生 Proxy 時所需要的資訊。Information required to generate a proxy.

例外狀況

這個執行個體不是有效的遠端物件。This instance is not a valid remoting object.

立即呼叫端沒有基礎結構使用權限。The immediate caller does not have infrastructure permission.

備註

CreateObjRef方法透過呼叫遠端物件的建立方法這類AppDomain.CreateInstanceAppDomain.CreateInstanceAndUnwrapThe CreateObjRef method is called by remote object creation methods such as AppDomain.CreateInstance and AppDomain.CreateInstanceAndUnwrap. 在大部分情況下,沒有需要覆寫這個方法。In most cases, there is no need to override this method.

安全性

SecurityCriticalAttribute
需要完全信任立即呼叫端。requires full trust for the immediate caller. 此成員不能由部分信任或不透明的程式碼。This member cannot be used by partially trusted or transparent code.

適用於