Esempio n. 1
0
 /// <summary>
 /// 静态构造器
 /// </summary>
 static LogAdapter()
 {
     // 组装路径
     strDatabaseExPath = AppDomain.CurrentDomain.BaseDirectory + ConfigAdapter.GetConfigNote("DatabaseExLogPath");
     strBusinessExPath = AppDomain.CurrentDomain.BaseDirectory + ConfigAdapter.GetConfigNote("BusinessExLogPath");
     strFeaturesExPath = AppDomain.CurrentDomain.BaseDirectory + ConfigAdapter.GetConfigNote("FeaturesExLogPath");
     strCustomLogPath  = AppDomain.CurrentDomain.BaseDirectory + ConfigAdapter.GetConfigNote("CustomLogPath");
     strServiceLogPath = AppDomain.CurrentDomain.BaseDirectory + ConfigAdapter.GetConfigNote("ServiceLogPath");
 }
        static ConnectionPool()
        {
            //db = DatabaseFactory.CreateDatabase() as SqlDatabase;

            string _connectionStringSet = ConfigAdapter.GetConfigNote("SetConnectionString").Trim();
            string _connectionString    = _connectionStringSet;

            if (String.Empty != _connectionStringSet)
            {
                _connectionStringSet = DataSecurity.Encrypt(_connectionStringSet);
                ConfigAdapter.SetConfigNote("ConnectionString", _connectionStringSet);
                ConfigAdapter.SetConfigNote("SetConnectionString", String.Empty);
            }
            else
            {
                _connectionString = ConfigAdapter.GetConfigNote("ConnectionString");
                _connectionString = DataSecurity.Decrypt(_connectionString);
            }
            db = new SqlDatabase(_connectionString);
        }