Ler en inglés Editar

Compartir por


Activator.GetObject Method

Definition

Creates a proxy for a well-known object or XML Web service.

Overloads

GetObject(Type, String)

Creates a proxy for the well-known object indicated by the specified type and URL.

GetObject(Type, String, Object)

Creates a proxy for the well-known object indicated by the specified type, URL, and channel data.

GetObject(Type, String)

Creates a proxy for the well-known object indicated by the specified type and URL.

C#
public static object GetObject(Type type, string url);
C#
[System.Security.SecurityCritical]
public static object GetObject(Type type, string url);

Parameters

type
Type

The type of the well-known object to which you want to connect.

url
String

The URL of the well-known object.

Returns

A proxy that points to an endpoint served by the requested well-known object.

Attributes

Exceptions

type or url is null.

type is not marshaled by reference and is not an interface.

This member was invoked with a late-binding mechanism.

Remarks

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.

See also

Applies to

.NET Framework 4.8.1 e outras versións
Produto Versións
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

GetObject(Type, String, Object)

Creates a proxy for the well-known object indicated by the specified type, URL, and channel data.

C#
public static object GetObject(Type type, string url, object state);
C#
[System.Security.SecurityCritical]
public static object GetObject(Type type, string url, object state);

Parameters

type
Type

The type of the well-known object to which you want to connect.

url
String

The URL of the well-known object.

state
Object

Channel-specific data or null.

Returns

A proxy that points to an endpoint served by the requested well-known object.

Attributes

Exceptions

type or url is null.

type is not marshaled by reference and is not an interface.

This member was invoked with a late-binding mechanism.

Remarks

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.

The state parameter communicates information to the channel, and is passed to the IChannelSender.CreateMessageSink method.

See also

Applies to

.NET Framework 4.8.1 e outras versións
Produto Versións
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1