📜  访问对象属性 C# 代码示例

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

代码示例1
System.Reflection.PropertyInfo prop = typeof(YourType).GetProperty("PropertyName");

object value = prop.GetValue(yourInstance);
...
prop.SetValue(yourInstance, "value");