I have multiple classes, named A, B and C. I want to get the attributes of all classes and their values. How can I do this?
I can get the attribute names of (eg) the class "A" by;
But I'm not able to get their values.
I can get the attribute names of (eg) the class "A" by;
Code:
Type classType = A.GetType();
PropertyInfo[] a_pi = classType.GetProperties();
foreach (PropertyInfo pi in a_pi)
Console.WriteLine(pi.Name);
Comment