C# 如何读取匿名类型Anonymous Type的属性

示例的匿名对象格式如下,目的是想要得到result.result的值:

customObj<Anonymous Type> = {
  msg: "",
  result:<Anonymous Type>
}
string rs = customObj.GetType().GetProperty("result").GetValue(customObj, null);

 

原文链接:https://stackoverflow.com/questions/9750078/get-value-from-anonymous-type?answertab=votes#tab-top

posted @ 2020-04-24 10:45  最好的年纪  阅读(953)  评论(0编辑  收藏  举报