void ExecuteCommandName() { var folderBase = FolderPath; if (Directory.Exists(folderBase)) { BtnEnable = false; var handledFolder = System.IO.Path.Combine(folderBase, "Handled"); if (!Directory.Exists(handledFolder)) { Directory.CreateDirectory(handledFolder); } else { var msgResult = MessageBox.Show("转换后将会覆盖Handled文件夹里的文件", "注意", MessageBoxButton.YesNo); if (msgResult != MessageBoxResult.Yes) { BtnEnable = true; return; } } var excelTool = new ExcelTool(folderBase, handledFolder); Task.Run(() => excelTool.Handle(ExcuteMsg)); } else { MessageBox.Show("文件目录不存在"); } }