Look into the Systsem.Reflection namespace.
As a hint, all objects inherit from the base System.Object class which has a GetType() function.
Type typ = myObj.GetType();
This "Type" class has many functions for displaying the list of functions, properties, etc ... that an object supports.
: Hi,
:
: I ask for a methode to listing members of a class. The names, types and values of a member of a class should be readable.
:
: Is there any possibility to read this information at runtime and put it into a string?
:
: Thx for response
:
: Bert
:
: PS:
: Example:
:
: class MyClass
: {
: public int Member1;
: public OtherClass Member2;
: public string Member3;
:
: public MyClass();
: public int Member4(int arg);
: }
: ...
: Console.WriteLine(ListMembersOf(MyClass));
:
: Wished Result:
:
: int Member1 = 3
: System.FavouriteNamespace.OtherClass Member2 = xyz
: string Member3 = String of Member3
: MyClass()
: int Member4(int arg)
:
: