【发布时间】:2018-03-05 18:18:56
【问题描述】:
我想通过如下所示的路径获取propertyInfo:
string path = "window.position.x";
这里是一个例子:
PropertyInfo p = typeof(WindowManager).GetProperty(path);
WindowManager 有一个名为“window”的属性,它有一个名为“position”的属性,它又具有属性“x”。
有什么方法可以实现吗?不幸的是GetProperty 不适用于这样的路径。
【问题讨论】:
-
你试过了吗:Environment.GetEnvironmentVariables("Path")
标签: c# system.reflection propertyinfo