【发布时间】:2023-07-05 18:21:02
【问题描述】:
我有以下代码:
Process scriptProc = new Process();
scriptProc.StartInfo.FileName = @"cscript";
scriptProc.Start();
scriptProc.WaitForExit();
scriptProc.Close();
我想隐藏执行上述代码时将显示的那个 cscript 窗口。有什么方法可以在 winform 进度条控件中显示上述脚本进度?
谢谢。
【问题讨论】:
-
你能附加一个监听器,它在每次 cscript 写入控制台时运行?如果是这样,您可以通过解析输出来监控进度,从而更新进度条。
-
任何带有完整源代码示例的最终解决方案?