Export (0) Print
Expand All

_Type.InvokeMember Method (String, BindingFlags, Binder, Object, Object[])

Provides COM objects with version-independent access to the Type.InvokeMember method.

Namespace:  System.Runtime.InteropServices
Assembly:  mscorlib (in mscorlib.dll)

Object InvokeMember(
	string name,
	BindingFlags invokeAttr,
	Binder binder,
	Object target,
	Object[] args
)

Parameters

name
Type: System.String

The String containing the name of the constructor, method, property, or field member to invoke.

-or-

An empty string ("") to invoke the default member.

-or-

For IDispatch members, a string representing the DispID, for example "[DispID=3]".

invokeAttr
Type: System.Reflection.BindingFlags

A bitmask comprised of one or more BindingFlags that specify how the search is conducted. The access can be one of the BindingFlags such as Public, NonPublic, Private, InvokeMethod, GetField, and so on. The type of lookup need not be specified. If the type of lookup is omitted, BindingFlags.Public | BindingFlags.Instance will apply.

binder
Type: System.Reflection.Binder

A Binder object that defines a set of properties and enables binding, which can involve selection of an overloaded method, coercion of argument types, and invocation of a member through reflection.

-or-

null, to use the DefaultBinder.

target
Type: System.Object

The Object on which to invoke the specified member.

args
Type: System.Object[]

An array containing the arguments to pass to the member to invoke.

Return Value

Type: System.Object
An Object representing the return value of the invoked member.

This method is for access to managed classes from unmanaged code, and should not be called from managed code.

The Type.InvokeMember method invokes the specified member, using the specified binding constraints and matching the specified argument list.

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft