Activator.GetObject 方法

定義

為已知物件或 XML Web Service 建立 Proxy。

多載

GetObject(Type, String)

為指定類型和 URL 所指示的已知物件建立 Proxy。

GetObject(Type, String, Object)

為指定類型、URL 和通道資料所指示的已知物件建立 Proxy。

GetObject(Type, String)

為指定類型和 URL 所指示的已知物件建立 Proxy。

public:
 static System::Object ^ GetObject(Type ^ type, System::String ^ url);
public static object GetObject (Type type, string url);
[System.Security.SecurityCritical]
public static object GetObject (Type type, string url);
static member GetObject : Type * string -> obj
[<System.Security.SecurityCritical>]
static member GetObject : Type * string -> obj
Public Shared Function GetObject (type As Type, url As String) As Object

參數

type
Type

您要連接的已知物件類型。

url
String

已知物件的 URL。

傳回

Object

Proxy,指向要求的已知物件所服務的端點。

屬性

例外狀況

typeurlnull

type 不是以傳址方式封送處理,也不是介面。

這個成員曾被晚期繫結機制叫用過。

備註

呼叫 Proxy 以將訊息傳送至遠端物件。 在 Proxy 上呼叫方法之前,不會透過網路傳送任何訊息。

另請參閱

適用於

GetObject(Type, String, Object)

為指定類型、URL 和通道資料所指示的已知物件建立 Proxy。

public:
 static System::Object ^ GetObject(Type ^ type, System::String ^ url, System::Object ^ state);
public static object GetObject (Type type, string url, object state);
[System.Security.SecurityCritical]
public static object GetObject (Type type, string url, object state);
static member GetObject : Type * string * obj -> obj
[<System.Security.SecurityCritical>]
static member GetObject : Type * string * obj -> obj
Public Shared Function GetObject (type As Type, url As String, state As Object) As Object

參數

type
Type

您要連接的已知物件類型。

url
String

已知物件的 URL。

state
Object

通道特定資料或 null

傳回

Object

Proxy,指向要求的已知物件所服務的端點。

屬性

例外狀況

typeurlnull

type 不是以傳址方式封送處理,也不是介面。

這個成員曾被晚期繫結機制叫用過。

備註

呼叫 Proxy 以將訊息傳送至遠端物件。 在 Proxy 上呼叫方法之前,不會透過網路傳送任何訊息。

參數 state 會將資訊傳達給通道,並傳遞至 IChannelSender.CreateMessageSink 方法。

另請參閱

適用於