<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();
时间: 2024-10-26 09:33:59