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(); }
/// <summary> /// 不使用默认值时重新初始化 /// </summary> public void ResetInit() { RemoveConfig(); bDBHelper.EnvHome = KVDir; bDBHelper.Reset(); sqliteHelper.ConnectString = LocalSQLFile; sqliteHelper.CreateEmptyDB(LocalSQLFile); LoadRedisCfg(); }