共用方式為


RealProxy.GetStubData(RealProxy) 方法

定義

擷取替指定之 Proxy 儲存的 Stub 資料。

public:
 static System::Object ^ GetStubData(System::Runtime::Remoting::Proxies::RealProxy ^ rp);
public static object GetStubData (System.Runtime.Remoting.Proxies.RealProxy rp);
[System.Security.SecurityCritical]
public static object GetStubData (System.Runtime.Remoting.Proxies.RealProxy rp);
static member GetStubData : System.Runtime.Remoting.Proxies.RealProxy -> obj
[<System.Security.SecurityCritical>]
static member GetStubData : System.Runtime.Remoting.Proxies.RealProxy -> obj
Public Shared Function GetStubData (rp As RealProxy) As Object

參數

rp
RealProxy

為之要求 Stub 資料的 Proxy。

傳回

指定 Proxy 的 Stub 資料。

屬性

例外狀況

目前的呼叫端沒有 UnmanagedCode 權限。

範例

// Create an instance of MyProxy.
MyProxy^ myProxyInstance = gcnew MyProxy( CustomServer::typeid );

// Get a CustomServer proxy.
CustomServer^ myHelloServer = static_cast<CustomServer^>(myProxyInstance->GetTransparentProxy());

// Get stubdata.
Console::WriteLine( "GetStubData = {0}", RealProxy::GetStubData( myProxyInstance ) );
// Create an instance of MyProxy.
MyProxy myProxyInstance = new MyProxy(typeof(CustomServer));
// Get a CustomServer proxy.
CustomServer myHelloServer = (CustomServer)myProxyInstance.GetTransparentProxy();
// Get stubdata.
Console.WriteLine("GetStubData = " + RealProxy.GetStubData(myProxyInstance).ToString());
' Create an instance of MyProxy.
Dim myProxyInstance As New MyProxy(GetType(CustomServer))
' Get a CustomServer proxy.
Dim myHelloServer As CustomServer = _
            CType(myProxyInstance.GetTransparentProxy(), CustomServer)
' Get stubdata.
Console.WriteLine("GetStubData = " + RealProxy.GetStubData(myProxyInstance).ToString())

備註

自訂 Proxy 使用者會使用存根數據來決定使用傳入方法呼叫的動作。 例如,存根數據可能是伺服器內容的相關信息,可用來判斷是否要在本機執行呼叫,或透過遠端基礎結構傳送它。

適用於