<appSettings>
    <add key="SiteURL" value="http://moss2007:7000" />
    <add key="WebURL" value="" />
  </appSettings>

 

在页面读取: private string siteUrl = ConfigurationManager.AppSettings["SiteURL"];

 

 

<connectionStrings>
    <!--<add name="LogDBConn" connectionString="Data Source=11.192.241.151;Initial Catalog=MOSS_Log;User ID=sa;Password=Password01!"/>-->
    <add name="LogDBConn" connectionString="Data Source=moss2007;Integrated Security=True;Initial Catalog=MOSS_Log" />
  </connectionStrings>

在页面读取:string strLogDBConn = System.Web.Configuration.WebConfigurationManager.ConnectionStrings["LogDBConn"].ToString();

posted on 2012-05-15 14:29  染指的浮云  阅读(11494)  评论(0编辑  收藏  举报