SmartSQL/SmartSQL.DocUtils/DBDoc/Doc.cs

(开头部分) 2KB

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

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SmartSQL.DocUtils.Dtos;
using ZetaLongPaths;

namespace SmartSQL.DocUtils.DBDoc
{
    public abstract class Doc
    {
        /// <summary>
        /// 当前应用程序的名称 => SmartSQL
        /// </summary>
        private static string ConfigFileName = "SmartSQL";

        /// <summary>
        /// 定义配置存放的路径 => C:\Users\用户名\AppData\Roaming\SmartSQL
        /// </summary>
        public static string AppPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData, Environment.SpecialFolderOption.Create), ConfigFileName);

        /// <summary>
        /// 定义模板文件存放的路径
        /// </summary>
        public static string TplPath = Path.Combine(AppPath, "TplFile");

        public Doc(DBDto dto, string filter)
        {
            this.Dto = dto;
            this.Filter = filter;
            var dbName = dto.DBName;
            if (dbName.Contains(":"))
            {
                dbName = dbName.Replace(":", "");
            }
            this.WorkTmpDir = Path.Combine(AppPath, dto.DBType + "_" + dbName);
            if (ZlpIOHelper.DirectoryExists(this.WorkTmpDir))
            {
                ZlpIOHelper.DeleteDirectory(this.WorkTmpDir, true);
            }
            ZlpIOHelper.CreateDirectory(this.WorkTmpDir);
            this.Ext = this.Filter.Split(new string[] { "|" }, StringSplitOptions.RemoveEmptyEntries).LastOrDefault()?.Trim('*');
        }

        /// <summary>
        /// 临时文件的存放目录
        /// </summary>
        public string WorkTmpDir { get; private set; }

        /// <summary>
        /// 文件扩展名
        /// </summary>
        public string Ext { get; set; }

        /// <summary>
        /// 数据库Dto
        /// </summary>
        public DBDto Dto { get; }
后面还有 12 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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