獲取所有欄位的值:
public void PrintProperties(Object obj) { Type type = obj.GetType(); foreach( PropertyInfo p in type.GetProperties()) { Console.Write(p.GetValue()); } }
獲取所有欄位的值:
public void PrintProperties(Object obj) { Type type = obj.GetType(); foreach( PropertyInfo p in type.GetProperties()) { Console.Write(p.GetValue()); } }