code/App.cs

(开头部分) 2KB

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

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WR_Excel
{
    public class App
    {
        public static string WorkPath = string.Empty;
        public static App Inst;
        static App()
        {
            Inst = new App();
        }
        private Dictionary<string, string> _sheetNames = new Dictionary<string, string>();

        public void Start(string workpath)
        {
            WorkPath = workpath;
            this.Start();
        }

        public void Start()
        {
            if (WorkPath == string.Empty)
            {
                string curpath = Directory.GetCurrentDirectory();

                WorkPath = curpath.Substring(0, curpath.IndexOf("bin"));
            }
            LoadAttrKeys();

            Loger.Log("导出目录:" + WorkPath);
            
            try
            {
                ReadAllExcels();
            }
            catch (Exception e)
            {
                Loger.LogError(e.ToString());
            }
        }

        public void ReadAllExcels()
        {
            var files = Directory.GetFiles(WorkPath, "*.xls?", SearchOption.TopDirectoryOnly);
            foreach (var file in files)
            {
                var filename = Path.GetFileName(file);
                if (filename.Contains("#") || filename.StartsWith("~$"))
                    continue;

                UseEpplus.ExportExcel(file);
            }
        }

        public void ReadExcelFile(string filepath)
后面还有 40 行代码,解锁后查看完整代码

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

AI 解读

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

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