예제 #1
0
        public DBServer()
        {
            if (!Directory.Exists("LocalSQLDB"))
            {
                Directory.CreateDirectory("LocalSQLDB");
            }
            if (!Directory.Exists("DBCfg"))
            {
                Directory.CreateDirectory("DBCfg");
            }
            LocalSQLFile = Path.Combine("LocalSQLDB", "localdb.db");
            KVDir        = "LocalKVDB";
            SQLCfgDir    = "DBCfg";
            RedisCfg     = Path.Combine("DBCfg", "Redis.Cfg");
            memHelper    = new SqliteHelper();
            bDBHelper    = new BDBHelper <object, object>();

            kvdir             = bDBHelper.EnvHome;
            bDBHelper.EnvHome = KVDir;
            bDBHelper.Reset();
            sqliteHelper = new SqliteHelper();
            sqliteHelper.ConnectString = LocalSQLFile;
            sqliteHelper.CreateEmptyDB(LocalSQLFile);
            DBAcessPool.SetConfigDir(SQLCfgDir);
            LoadRedisCfg();
        }
예제 #2
0
        /// <summary>
        /// 不使用默认值时重新初始化
        /// </summary>

        public void ResetInit()
        {
            RemoveConfig();
            bDBHelper.EnvHome = KVDir;
            bDBHelper.Reset();
            sqliteHelper.ConnectString = LocalSQLFile;
            sqliteHelper.CreateEmptyDB(LocalSQLFile);
            LoadRedisCfg();
        }