📌  相关文章
📜  如何在 c# 代码示例中从对象中获取值

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

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