通过页面修改Web.Config中属性值
来源:互联网 发布:网上黄金交易软件 编辑:程序博客网 时间:2024/05/21 09:58
string server = txtServer.Text;string database = txtDatabase.Text;string user = txtUser.Text;string pass = txtPass.Text;string filepath = txtFilePath.Text;Configuration config=WebConfigurationManager.OpenWebConfiguration("~");AppSettingsSection appSetting = (AppSettingsSection)config.GetSection("appSettings");ConnectionStringsSection connSettings = (ConnectionStringsSection)config.GetSection("connectionStrings");appSetting.Settings["filePath"].Value = filepath;connSettings.ConnectionStrings["sqlserver"].ConnectionString = "Data Source=" + server + ";Database=" + database + ";uid=" + user + ";pwd=" + pass;config.Save();//保存web.config
设置AppSetting、ConnectionString
- 通过页面修改Web.Config中属性值
- 页面属性 web.config OutputCache
- **web.config**页面传参部分乱码,通过修改webconfig 解决问题
- 如何通过代码修改web.config文件?
- 如何通过代码修改web.config文件
- 如何通过代码修改web.config文件
- 在VisualStudio 2012中通过SmallSharp压缩js及修改web.config
- ASP.NET程序中动态修改web.config中的设置项目(前台页面代码)
- web.config中httpRunTime的属性
- web.config中httpRunTime的属性
- web.config中httpRunTime的属性
- 通过修改Web.Config上传大于4M的文件
- 动态修改web.config的值
- 修改Web.Config里的值
- 代码修改web.config
- 修改web.config
- 修改web.config
- 修改Web.config
- Property Animations: The New Animation API
- cocos2d场影转换方式汇总
- 编写SQL注意事项----一天一句(三)
- 在 magento产品页面显示评论表单(review form)
- 在VMware下实现主机与虚拟主机之间的IPv6通信
- 通过页面修改Web.Config中属性值
- jquery 时间段
- 女程序员的职业规划
- 项目--教师日常办公平台中的活动图
- php手册-字符串连接符
- ListView显示图片失真
- 推荐几个不错的jQuery图表插件,让你的报表更清晰动感
- MFC多文档应用程序同时显示两个视图
- 联想收购诺基亚?玩笑而已别太当真