コード例 #1
0
 static ServerConfig()
 {
     try
     {
         connStr = string.Format("server={0};uid={1};pwd={2};database={3}",
                                 CfgIniFile.IniReadValue("SERVER_CONFIG", "IPADDRESS", IniFileName),
                                 CfgIniFile.IniReadValue("SERVER_CONFIG", "USER", IniFileName),
                                 CfgIniFile.IniReadValue("SERVER_CONFIG", "PASSWORD", IniFileName),
                                 CfgIniFile.IniReadValue("SERVER_CONFIG", "DATABASE", IniFileName));
     }
     catch
     {
         connStr = string.Empty;
         err     = "Config Read Error";
     }
 }
コード例 #2
0
ファイル: ServerConfig.cs プロジェクト: fengyubox/SFIS
 static ServerConfig()
 {
     try
     {
         connStr = string.Format("Password={2};User ID={1};server={0}",
                                 CfgIniFile.IniReadValue("SERVER_CONFIG", "DATABASE", IniFileName),
                                 DecryptString(CfgIniFile.IniReadValue("SERVER_CONFIG", "USER", IniFileName)),
                                 DecryptString(CfgIniFile.IniReadValue("SERVER_CONFIG", "PASSWORD", IniFileName)));
         //connStr = string.Format("Data Source={0};User ID={1};Password={2}",
         //     CfgIniFile.IniReadValue("SERVER_CONFIG", "DATABASE", IniFileName),
         //     DecryptString(CfgIniFile.IniReadValue("SERVER_CONFIG", "USER", IniFileName)),
         //     DecryptString(CfgIniFile.IniReadValue("SERVER_CONFIG", "PASSWORD", IniFileName)));
     }
     catch
     {
         connStr = string.Empty;
         err     = "Config Read Error";
     }
 }