110,566
社区成员
发帖
与我相关
我的任务
分享
Type objType = Type.GetType("ConsoleApplication1.A_B");
PropertyInfo[] pi = objType.GetProperties();
Console.WriteLine(pi[0].PropertyType);
命名空间.A_B obj = new 命名空间.A_B();
Type objType = Type.GetType("命名空间.A_B");
PropertyInfo propertyInfo = objType.GetProperty("PropertyName", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static);
object propertyValue = propertyInfo.GetValue(obj, null);