This documentation is archived and is not being maintained.

FormatterServices.GetObjectData Method

Extracts the data from the specified object and returns it as an array of objects.

[Visual Basic]
Public Shared Function GetObjectData( _
   ByVal obj As Object, _
   ByVal members() As MemberInfo _
) As Object()
public static object[] GetObjectData(
 object obj,
 MemberInfo[] members
public: static Object* GetObjectData(
 Object* obj,
 MemberInfo* members[]
)  __gc[];
public static function GetObjectData(
   obj : Object,
 members : MemberInfo[]
) : Object[];


The object to write to the formatter.
The members to extract from the object.

Return Value

An array of Object containing data stored in members and associated with obj.


Exception Type Condition
ArgumentNullException The obj or members parameter is a null reference (Nothing in Visual Basic).

An element of members is a null reference (Nothing).

SerializationException An element of members does not represent a field.


For each supplied member of the members array the GetObjectData method extracts the value associated with the obj object, and returns it. The length of the returned array is the same as the length of the members array.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

.NET Framework Security: 

See Also

FormatterServices Class | FormatterServices Members | System.Runtime.Serialization Namespace