zhuxiang1633
Object obj = new { name="admin",age=123 ,pwd="123" };
//遍历匿名对象
foreach (System.Reflection.PropertyInfo p in obj.GetType().GetProperties())
{
    Console.WriteLine("name:{0},value:{1}",p.Name,p.GetValue(obj));
}

 

分类:

技术点:

相关文章:

  • 2021-07-08
  • 2021-11-04
  • 2021-06-25
  • 2021-09-22
  • 2021-12-02
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-02-04
  • 2022-12-23
  • 2021-12-30
  • 2022-01-09
相关资源
相似解决方案