日期:2014-05-17 浏览次数:20528 次
<?xml version="1.0" encoding="utf-8" ?> <configuration> <appSettings> <add key="xxxx" value="......"/> </appSettings> <connectionStrings> <add name="xxxxxx" connectionString="Data Source=xxxxxx;Initial Catalog=DB;User ID=sa;Password=" providerName="System.Data.SqlClient"/> </connectionStrings> </configuration>
------解决方案--------------------
global::xxx.Properties.Settings.Default.xxx
------解决方案--------------------
获取<appSettings>中键的方法:
System.Configuration.ConfigurationManager.AppSettings["应用程序设置键名"]
获取<connectionStrings>中连接串的方法:
System.Configuration.ConfigurationManager.ConnectionStrings["连接串名"].ConnectionString
------解决方案--------------------
友情支持 up