文章出處

 

讀取web.config數據,可以不用編譯。如發布后,非常有用
web.config文件
<configuration>
<appSettings> <add key="Pwd" value="yms6666" /> </appSettings> </configuration> c#后臺代碼讀取Key為Pwd的數據
 string pwd= System.Configuration.ConfigurationManager.AppSettings["Pwd"];

 連接字符串:

 

return new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["WebJakeCS"].ConnectionString);

return new SqlConnection(System.Web.Configuration.WebConfigurationManager.ConnectionStrings["WebJakeCS"].ToString());


文章列表




Avast logo

Avast 防毒軟體已檢查此封電子郵件的病毒。
www.avast.com


arrow
arrow
    全站熱搜
    創作者介紹
    創作者 大師兄 的頭像
    大師兄

    IT工程師數位筆記本

    大師兄 發表在 痞客邦 留言(0) 人氣()