Activator.GetObject Activator.GetObject Activator.GetObject Method

定义

为已知对象或 XML Web services 创建一个代理。Creates a proxy for a well-known object or XML Web service.

重载

GetObject(Type, String) GetObject(Type, String) GetObject(Type, String)

为指定类型和 URL 所指示的已知对象创建一个代理。Creates a proxy for the well-known object indicated by the specified type and URL.

GetObject(Type, String, Object) GetObject(Type, String, Object) GetObject(Type, String, Object)

为指定类型、URL 和通道数据所指示的已知对象创建一个代理。Creates a proxy for the well-known object indicated by the specified type, URL, and channel data.

GetObject(Type, String) GetObject(Type, String) GetObject(Type, String)

为指定类型和 URL 所指示的已知对象创建一个代理。Creates a proxy for the well-known object indicated by the specified type and URL.

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

参数

type
Type Type Type

希望连接到的已知对象的类型。The type of the well-known object to which you want to connect.

url
String String String

已知对象的 URL。The URL of the well-known object.

返回

一个代理,它指向由所请求的已知对象服务的终结点。A proxy that points to an endpoint served by the requested well-known object.

异常

typeurlnulltype or url is null.

type 不会通过参考封送并且并非接口。type is not marshaled by reference and is not an interface.

使用晚期绑定机制调用了此成员。This member was invoked with a late-binding mechanism.

注解

调用代理以将消息发送到远程对象。Call the proxy to send messages to the remote object. 在代理上调用方法之前,不会通过网络发送消息。No messages are sent over the network until a method is called on the proxy.

安全性

SecurityCriticalAttribute
需要对直接调用方的完全信任。Requires full trust for the immediate caller. 部分受信任的或透明的代码不能使用此成员。This member cannot be used by partially trusted or transparent code.

另请参阅

GetObject(Type, String, Object) GetObject(Type, String, Object) GetObject(Type, String, Object)

为指定类型、URL 和通道数据所指示的已知对象创建一个代理。Creates a proxy for the well-known object indicated by the specified type, URL, and channel data.

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

参数

type
Type Type Type

希望连接到的已知对象的类型。The type of the well-known object to which you want to connect.

url
String String String

已知对象的 URL。The URL of the well-known object.

state
Object Object Object

通道特定的数据或 nullChannel-specific data or null.

返回

一个代理,它指向由所请求的已知对象服务的终结点。A proxy that points to an endpoint served by the requested well-known object.

异常

typeurlnulltype or url is null.

type 不会通过参考封送并且并非接口。type is not marshaled by reference and is not an interface.

使用晚期绑定机制调用了此成员。This member was invoked with a late-binding mechanism.

注解

调用代理以将消息发送到远程对象。Call the proxy to send messages to the remote object. 在代理上调用方法之前,不会通过网络发送消息。No messages are sent over the network until a method is called on the proxy.

参数将信息传递给通道,并将其传递IChannelSender.CreateMessageSink给方法。 stateThe state parameter communicates information to the channel, and is passed to the IChannelSender.CreateMessageSink method.

安全性

SecurityCriticalAttribute
需要对直接调用方的完全信任。Requires full trust for the immediate caller. 部分受信任的或透明的代码不能使用此成员。This member cannot be used by partially trusted or transparent code.

另请参阅

适用于