ConfigurationManager读取dll的配置文件 最近一个项目,需要发布dll给第三方使用,其中需要一些配置参数. 我们知道.NET的exe工程是自带的App.config文件的,编译之后会生成XX.exe.config文件, 使用静态类ConfigurationManager即可读取. string ip = ConfigurationManager.AppSettings["ServerIP"]; int port = Convert.ToInt32(Configura…
我这里用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;…
首先请在VS里打开下面的文件,我们将对源码分段进行说明: 步骤1:读取debug.ini文件 首先读取当前文件夹(.\Clients\Form)的debug.ini文件,该文件的args用于调试时传参,这样就不用每次都要到[Project/Properties]去设置[Commamd line argument].在debug阶段设置debug=true:在release阶段设置debug=false,或者直接把该文件删除.如果运行.\Clients\Form\Run.exe没有带参数,传递参数…
DLL-with-configuration-file带配置文件的dll http://www.codeproject.com/Tips/199441/DLL-with-configuration-file Accessing Properties.Settings userSettings from a DLL http://stackoverflow.com/questions/6445867/accessing-properties-settings-usersettings-from-a…