config文件 反射方法

 string testPropertyName = "MainFormText";

                Properties.Settings setting = Properties.Settings.Default;
                Type type = setting.GetType();

                PropertyInfo propertyInfo = type.GetProperty(testPropertyName);
                string value = (string)propertyInfo.GetValue(setting, null);
转载 请注明原文地址并标明转载:http://www.cnblogs.com/laopo 商业用途请与我联系:lcfhn168@163.com
原文地址:https://www.cnblogs.com/laopo/p/4237071.html