配置文件添加读取节点
//配置文件中添加
<configuration> <appSettings> <add key="userName" value=" "/> <add key="password" value=" "/> </appSettings> </configuration>
获取:
ConfigurationManager.AppSettings["userName"].ToString(); ConfigurationManager.AppSettings["password"].ToString();
需要引用