Luc, I managed to re-work your example to give me just what I was after. Thanks for putting me on the right track:
private void ShowData()
{
Type type = typeof(MyClass);
FieldInfo[] fi = type.GetFields();
foreach (FieldInfo info in fi)
{
Debug.WriteLine(info.Name + " = " + info.GetValue(varMyClass));
}
}
varMyClass is a variable of type MyClass. Thanks to all who helped.
modified on Thursday, July 2, 2009 1:41 PM