RealProxy.GetStubData(RealProxy) Metoda

Definicja

Pobiera dane wycinka przechowywane dla określonego serwera proxy.

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

Parametry

rp
RealProxy

Serwer proxy, dla którego są żądane dane wycinka.

Zwraca

Dane zastępcze dla określonego serwera proxy.

Atrybuty

Wyjątki

Bezpośredni obiekt wywołujący nie ma uprawnienia UnmanagedCode.

Przykłady

// 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())

Uwagi

Dane wycinka są używane przez niestandardowych użytkowników serwera proxy do decydowania, co zrobić z przychodzącym wywołaniem metody. Na przykład dane wycinka mogą być informacjami o kontekście serwera, którego można użyć do określenia, czy wykonać wywołanie lokalnie, czy też wysyłać je za pośrednictwem infrastruktury komunikacji telefonicznej.

Dotyczy