📜  c#动态对象获取值 - C#代码示例

📅  最后修改于: 2022-03-11 14:49:03.209000             🧑  作者: Mango

代码示例1
var nameOfProperty = "property1";
var propertyInfo = myObject.GetType().GetProperty(nameOfProperty);
var value = propertyInfo.GetValue(myObject, null);