Backup/13/BaseDB.cs

(开头部分) 4KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using Lon.Db;

namespace Lon
{
    abstract class BaseDB
    {
        //public static string CONN_STRING = "data source={0};datetimeformat=Ticks;synchronous=Off;cache size=10485760;page size=65536;"; //cache size = 10M
        public static string CONN_STRING = "data source={0};synchronous=Off;cache size=10485760;page size=65536;"; //cache size = 10M

        protected DBO dbo = null;
        public DBO Dbo
        {
            get { return dbo; }
        }

        protected string dbFileName = string.Empty;
        
        protected object synObject = new object();

        protected bool newCreate = false;

        public BaseDB(string dbFileName)
        {
            this.dbFileName = dbFileName;            
        }

        public BaseDB()
        {

        }

        ~BaseDB()
        {
        }


        public bool OpenDB()
        {
            if ((dbo != null && dbo.IsConnect) | (dbFileName == string.Empty)) return false;

            bool flag = !File.Exists(dbFileName);

            string connStr = string.Format(CONN_STRING, dbFileName);

            dbo = new DBO(DbType.SQLite, connStr, false);

            dbo.Open(false);


            if (!dbo.IsConnect)
            {
                return false;
            }

            return true;
        }
后面还有 141 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。