DownloaderSvc/DbService.cs

(开头部分) 26KB

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

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Data.SQLite;
using System.Transactions;
using System.Threading;

namespace DownloaderSvc
{
    //public class DbService
    //{
    //    private string dbName;
    //    private string dbPath;

    //    public string DbFile
    //    {
    //        get 
    //        {
    //            return Path.Combine(dbPath, dbName);
    //        }
    //    }
    //    private static DbService _dbService;

    //    private DbService()
    //    {
    //        dbName = "DownLoaderWPF.db";
    //        dbPath = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
    //    }

    //    public static DbService Instance()
    //    { 
    //        if (_dbService == null)
    //        {
    //            _dbService = new DbService();
    //        }
    //        return _dbService;
    //    }

    //    //创建数据库文件
    //    public bool CreateDbFile()
    //    {
    //        bool result = false;
    //        try
    //        {
    //            SQLiteConnection.CreateFile(DbFile);
    //            if (File.Exists(DbFile))
    //            {
    //                result = true;
    //                Log.LogInfo(Log.LogLevel.INFO, "创建数据库文件成功, 路径: " + DbFile);
    //            }
    //            else
    //            {
    //                result = false;
    //                Log.LogInfo(Log.LogLevel.ERROR, "创建数据库文件失败!");
    //            }
    //        }
    //        catch (Exception ex)
    //        {
后面还有 658 行代码,解锁后查看完整代码

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

AI 解读

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

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