在WPF中读写config配置文件
来源:互联网 发布:方鸿渐和小姐 知乎 编辑:程序博客网 时间:2024/06/06 04:05
在WPF中读写config配置文件,很简单。
1. 在你的工程中,添加app.config文件。文件的内容默认为:
<?xml version="1.0" encoding="utf-8" ?><configuration></configuration>2.如果你想给程序配置一些参数,就在<configuration>标签中添加<appSettings>.例如:
<?xml version="1.0" encoding="utf-8" ?><configuration> <appSettings> <add key="Path" value="SFSFSDSDS"/> <add key="NAME" value="FUCk"/> </appSettings></configuration>3.然后你在程序里需要的地方读写它就可以了。先引用
using System.Configuration;4.读:
string str = ConfigurationManager.AppSettings["Path"];5.写:
Configuration cfa = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);cfa.AppSettings.Settings["NAME"].Value = "WANGLICHAO";cfa.Save();6.收工!
是不是有点太基础了!
- 在WPF中读写config配置文件
- 在WPF中读写config配置文件
- 在WPF中读写config配置文件
- WPF中读写config配置文件
- WPF中读写app.config操作
- WPF读写config配置文件及XML数据的学习
- c#,WinForm中读写配置文件App.config
- C#中动态读写App.config配置文件
- 读写配置文件app.config
- 读写配置文件app.config
- 读写配置文件app.config
- 读写配置文件app.config
- 读写配置文件app.config
- 读写配置文件app.config
- 读写配置文件app.config
- 读写config,xml配置文件
- C#读写config配置文件
- C#读写config配置文件
- Delphi的内存管理及内存泄露问题
- kmalloc详解
- ABAP算法:找出递归的物料
- cat /proc/meminfo
- ABAP:利用SAP定时器自动刷新LIST
- 在WPF中读写config配置文件
- Direct3D win32框架(显示每秒帧率)
- ABAP:利用SAP定时器自动刷新ALV
- HTML <frameset> 标签的使用
- 很多浮云,实质的很少
- SAP中的文档维护
- Android 支持的媒体格式(音频,视频,图片)
- SEO初学者需要了解的相关知识
- Android对图片的压缩读取和保存