private void BrowseFoldersButton_Click(object sender, EventArgs e) { #region 初始化 FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog(); folderBrowserDialog.Description = "Please select picture folders."; folderBrowserDialog.ShowNewFolderButton = true; #endregion #region Form处理 string folderPath = null; GDProcessEventArgs gDProcessEventArgs; if (folderBrowserDialog.ShowDialog() == DialogResult.OK) { if (string.IsNullOrEmpty(folderBrowserDialog.SelectedPath)) { MessageBox.Show("文件夹路径不能为空", "提示"); return; } else { folderPath = folderBrowserDialog.SelectedPath; } } gDProcessEventArgs = new GDProcessEventArgs( folderPathInput: folderPath, imageEnhanceStateInput: imageEnhanceCheckBox.Checked, outputCarInfoStateInput: OutputCarInfoCheckBox.Checked, initModeInput: initMode.inputByFiles.ToString() ); #endregion #region 创建进程进行python处理 GraduateDesignProcess graduate_DesignProcess = new GraduateDesignProcess(gDProcessEventArgsInput: gDProcessEventArgs); graduate_DesignProcess.GDprocessScript_ShowPicturesbyFiles(); graduate_DesignProcess.ShellRun(); #endregion }