【发布时间】:2010-11-15 09:58:45
【问题描述】:
我想通过反射机制获取属性名称。有可能吗?
更新: 我有这样的代码:
public CarType Car
{
get { return (Wheel) this["Wheel"];}
set { this["Wheel"] = value; }
}
因为我需要更多这样的属性,所以我想做这样的事情:
public CarType Car
{
get { return (Wheel) this[GetThisPropertyName()];}
set { this[GetThisPropertyName()] = value; }
}
【问题讨论】:
-
+1 我在实现 System.Configuration.ApplicationSettingsBase 时也想知道这个
标签: c# reflection properties