配置文件
<connectionStrings>
<add name="SecurityDB" connectionString="server=172.16.0.200;database=TripXSSFDB;uid=sa;pwd=tripxdb;Application Name=SecurityDB"
providerName="System.Data.SqlClient"/>
</connectionStrings>
if (ConfigurationManager.ConnectionStrings[connStringName] != null)
{
this._strConn = ConfigurationManager.ConnectionStrings[connStringName].ConnectionString;
}
else
{
this._strConn = ConfigurationManager.ConnectionStrings[ConfigurationManager.ConnectionStrings.Count - 1].ConnectionString;
}
<appSettings>
<add key="LoginUrl" value="SignIn.aspx"></add>
<appSettings>
ConfigurationManager.AppSettings.Get("LoginUrl").ToString()