From c6bf0cdf560e024ee54f98ce9291e854da5a13b0 Mon Sep 17 00:00:00 2001 From: sinvo Date: Fri, 20 Mar 2026 08:54:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E5=AE=8C=E6=88=90=E5=90=8E?= =?UTF-8?q?=E8=B0=83=E7=94=A8=E5=AD=90=E7=A8=8B=E5=BA=8Fover=EF=BC=8C?= =?UTF-8?q?=E4=BC=A0=E5=8F=82files=E4=B8=BA=E8=BE=93=E5=87=BA=E8=B7=AF?= =?UTF-8?q?=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 去掉"是否打开文件夹"对话框,改为设置Quicker变量 files=输出文件路径、over=true,然后关闭窗口。 ScannerForm构造函数接收IStepContext用于变量传递。 Co-Authored-By: Claude Opus 4.6 --- CamScanner.cs | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/CamScanner.cs b/CamScanner.cs index d99ab6a..a422e90 100644 --- a/CamScanner.cs +++ b/CamScanner.cs @@ -737,9 +737,11 @@ public class ScannerForm : Form private List inputFiles = new List(); private bool isPdfInput = false; + private Quicker.Public.IStepContext _context; - public ScannerForm() + public ScannerForm(Quicker.Public.IStepContext context) { + _context = context; InitUI(); } @@ -1040,13 +1042,10 @@ public class ScannerForm : Form lblStatus.Text = string.Format("完成!已保存: {0}", Path.GetFileName(outputPath)); - DialogResult dr = MessageBox.Show( - string.Format("处理完成!共 {0} 页。\n\n是否打开所在目录?", results.Count), - "完成", MessageBoxButtons.YesNo, MessageBoxIcon.Information); - if (dr == DialogResult.Yes) - { - System.Diagnostics.Process.Start("explorer.exe", "/select," + outputPath); - } + // 调用子程序 "over",传参 files 为输出文件路径 + _context.SetVarValue("files", outputPath); + _context.SetVarValue("over", true); + this.Close(); } catch (Exception ex) { @@ -1128,7 +1127,7 @@ public static void Exec(Quicker.Public.IStepContext context) Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new ScannerForm()); + Application.Run(new ScannerForm(context)); } [DllImport("kernel32.dll", SetLastError = true)]