webconfig存数据

来源:互联网 发布:袁姗姗网络暴力演讲稿 编辑:程序博客网 时间:2024/04/29 07:59

<location allowOverride="true" inheritInChildApplications="true">
           <appSettings>
               <add key="SQLConnString" value="server=192.168.100.108;user id=epuser;password=123;database=EpowerGKA;max pool size=100" />
               <add key="conUser" value="epuser" />
               <add key="conPassword" value="123" />
               <add key="DefaultSystem" value="101" />
               <add key="SystemModel" value="0" />
               <add key="SqlCacheModel" value="0" />
               <add key="SqlCacheDataSource" value="Epower_Issue" />
               <add key="CrystalImageCleaner-AutoStart" value="true" />
               <add key="CrystalImageCleaner-Sleep" value="60000" />
               <add key="CrystalImageCleaner-Age" value="120000" />
           </appSettings>
       </location>

 

 

 读取:

string user = ConfigTool.GetConnectString("conUser");
            string password = ConfigTool.GetConnectString("conPassword");

 

 

 

 

public static string GetConnectString(string sConnectName)
        {
            return System.Configuration.ConfigurationSettings.AppSettings[sConnectName];
        }

原创粉丝点击