Z
Zytan
This code works:
Type t = myVar.GetType();
System.Reflection.FieldInfo[] fields = t.GetFields();
foreach (System.Reflection.FieldInfo field in fields)
WriteLine(field.Name + " = " + field.GetValue(myVar);
But, when one of the fields is an array of string, this will just
print:
fieldName = System.String[]
How can I test to see if this type is an array of string, and handle
it differently? How can I use the return value of myField.GetType()
and test it against a string?
Zytan
Type t = myVar.GetType();
System.Reflection.FieldInfo[] fields = t.GetFields();
foreach (System.Reflection.FieldInfo field in fields)
WriteLine(field.Name + " = " + field.GetValue(myVar);
But, when one of the fields is an array of string, this will just
print:
fieldName = System.String[]
How can I test to see if this type is an array of string, and handle
it differently? How can I use the return value of myField.GetType()
and test it against a string?
Zytan