app.config文件的读写
来源:互联网 发布:node path resolve 编辑:程序博客网 时间:2024/04/19 16:15
下图为读取代码
#region 返回监控文件夹的路径
public String MoiDir()
{
String path = "";
ExeConfigurationFileMap file = new ExeConfigurationFileMap();
file.ExeConfigFilename = System.Windows.Forms.Application.ExecutablePath + ".config";
Configuration config = System.Configuration.ConfigurationManager.OpenMappedExeConfiguration(file, ConfigurationUserLevel.None);
public String MoiDir()
{
String path = "";
ExeConfigurationFileMap file = new ExeConfigurationFileMap();
file.ExeConfigFilename = System.Windows.Forms.Application.ExecutablePath + ".config";
Configuration config = System.Configuration.ConfigurationManager.OpenMappedExeConfiguration(file, ConfigurationUserLevel.None);
var myApp = (AppSettingsSection)config.GetSection("appSettings");
path = myApp.Settings["FilepPath"].Value;
return path;
}
return path;
}
#endregion
赋值代码只需要给myApp.Settings["FilepPath"].Value 赋值即可
0 0
- app.config文件的读写
- 读写App.config文件
- app.config文件读写
- C# 读写app.config文件
- winform中读写App.config文件
- C#中读写App.Config文件
- 【C#】【WPF】如何读写app.config文件
- WPF读写.exe.config 或 app.config文件
- App.config和配置文件的读写
- C# 读写App.config配置文件的方法
- [C#] 读写App.config配置文件的方法
- [C#] 读写App.config配置文件的方法
- 读写配置文件app.config
- 读写配置文件app.config
- 读写配置文件app.config
- 读写配置文件app.config
- 读写配置文件app.config
- 读写配置文件app.config
- mac gradle遇到问题
- Android OkHttp(一)初识
- POJ 5690 All X
- json循环依赖导致生成json失败
- Struts2-校验器优先校验配置
- app.config文件的读写
- 在eclipse中进行Android下JNI开发的步骤
- api23及以上应用请求权限的解决方案
- mysql之通过日志定时备份和恢复(下)
- 微信开发a标签跳转后点击返回键无法返回
- 创新+工匠,TCL推XESS重定义电视行业“高端”内涵
- Linux学习笔记 --- centos7下安装pymssql
- 修改unity3d创建的脚本模版
- ACdream 1429 Rectangular Polygon