配置文件

<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()

posted @ 2008-02-20 10:10  烈马狂生  阅读(199)  评论(0编辑  收藏  举报