【发布时间】:2023-03-10 18:44:01
【问题描述】:
我正在使用 C# 运行另一个 .exe 应用程序。
但是我想在后台运行 .exe 我尝试了 Start info hide 但没有帮助
我该怎么做?
目前这是我正在使用的代码
_p = new System.Diagnostics.Process();
_startInfro = new System.Diagnostics.ProcessStartInfo();
_startInfro.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
_startInfro.FileName = tmp[0];
_startInfro.Arguments = deleteRangeCommand;
_p.StartInfo = _startInfro;
_p.Start();
【问题讨论】:
-
你可以在这里找到你的问题的答案:.NET - WindowStyle = hidden vs. CreateNoWindow = true? - 如果它不是你的 exe 并且你不能实现额外的参数来隐藏进程,那么它可能不能做太多或者你需要使用一些的 Windows API 来实现这一点。 Anaways,当这些参数被哪个应用程序尊重时,您可以在那里阅读。