方法一
//Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); //获取AppSettings的节点
//AppSettingsSection appsection = (AppSettingsSection)config.GetSection("appSettings");
//this.txtYwlb.Text = appsection.Settings["YWLX"].Value;
方法二
string DesfilePath = ConfigurationManager.AppSettings["DesfilePathName"];
本文介绍了两种从配置文件中读取设置的方法。方法一通过ConfigurationManager获取AppSettings节点,并读取特定键的值;方法二直接使用ConfigurationManager.AppSettings读取指定键的值。

被折叠的 条评论
为什么被折叠?



