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);
posted @ 2015-01-20 18:45  每天进步一点点!  阅读(203)  评论(0)    收藏  举报