我这里用Winform和WebForm两种为例说明怎样操作xml文档来作为配置文件进行读取操作. 1.新建一个类,命名为"SystemConfig.cs".代码例如以下: <span style="font-family:Microsoft YaHei;font-size:14px;">using System; using System.Collections.Generic; using System.Text; using System.Xml;
ConfigurationManager读取dll的配置文件 最近一个项目,需要发布dll给第三方使用,其中需要一些配置参数. 我们知道.NET的exe工程是自带的App.config文件的,编译之后会生成XX.exe.config文件, 使用静态类ConfigurationManager即可读取. string ip = ConfigurationManager.AppSettings["ServerIP"]; int port = Convert.ToInt32(Configura