コード例 #1
0
ファイル: MainForm.cs プロジェクト: xzjGitHub/ExcelTools
    private void CreateButton_Click(object sender, EventArgs e)
    {
        ExcelData.CreateParams param = new ExcelData.CreateParams();
        param.IsCreateTextFile = IsCreateTextFile;
        param.IsCreateCSFile   = IsCreateCSFile;
        param.ClientCfgDir     = ClientCfgPath;
        param.ClientCSDir      = ClientCSPath;
        param.ServerCfgDir     = ServerCfgPath;
        param.ServerCSDir      = ServerCSPath;
        param.BattleCfgDir     = BattleCfgPath;
        param.BattleCSDir      = BattleCSPath;

        string[] filePaths = selectFileDialog.FileNames;
        for (int i = 0; i < filePaths.Length; i++)
        {
            string    filePath = filePaths[i];
            ExcelData data     = new ExcelData(filePath);
            if (data.Load())
            {
                data.Create(param);
            }

            //Dispose
            data.Dispose();
        }

        //保存本地配置
        SaveConfig();
    }