前几天试了试wwConfig, 虽然简单,但有些地方不太方便,如:读写指定的section, 读写一个列表,今天又找到一个,是开源的,功能更强,是Nini, http://nini.sourceforge.net/,下面是网站上的介绍:
- 支持多种配置类型 - INI, XML, .NET (web.config,), Windows 注册表以及命令行
- 强类型 - String, int, double, float,等. Eliminates casting
- 设置和保存 - Add, remove, and edit configuration variables using the same API. Also auto-saves files
- Unlimited files - Loads an unlimited number of configuration files
- Lightweight and fast - Utilizes an ordered hashtable for quick in-memory access
- Merging - Merge several configuration objects into a single object
- 开源 - Free for commercial and non-commercial purposes with source code
- 设置别名 - Add aliases for unclear variables like booleans from or "1" and "0" to a clear alias value like "On" and "Off"
- Key value replacement - Key values can be set to utilize the values of other keys (see following INI example):
key1 = someValue
key2 = Value of key 1: ${key1} - 跨平台 - Runs on the .NET Framework and Mono so it runs on Linux, Mac OS X, and Windows
- INI解析器 - Contains a 100% managed code enhanced INI parser
- 帮助文档 -See the Nini manual and the reference documentation