Sunday, September 12, 2010

Reflections: List the properties and values of a class

PropertyInfo[] props = typeof(ScheduledReport).GetProperties();
for (int i = 0; i <>
{
sbBody.Append(props[i].Name + " : " + props[i].GetValue(report, null) + "\n");
}

No comments:

Post a Comment