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);
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

浙公网安备 33010602011771号