获取所有字段的值:

public void PrintProperties(Object obj)
{
    Type type = obj.GetType();
    foreach( PropertyInfo p in type.GetProperties())
    {
        Console.Write(p.GetValue());
    }
}    

 

相关文章:

  • 2021-08-21
  • 2022-12-23
  • 2022-12-23
  • 2021-07-05
  • 2021-11-30
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-07-27
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案