为什么即使我将其设置为隐藏也显示控制台窗口?

问题描述 投票:0回答:1

如何摆脱控制台窗口?我有如下所示的ProcessStartInfo

   var processStartInfo = new ProcessStartInfo()
    {
       FileName = Path.Combine(path, "Hi.exe");,
       WindowStyle = ProcessWindowStyle.Hidden,
       UseShellExecute = false,
       CreateNoWindow = true,
        RedirectStandardInput = true,
     };
      Process.Start(processStartInfo).StandardInput.WriteLine(argHandlerArgs);
c# process console-application
1个回答
0
投票

按照the docs

要使用Hidden,UseShellExecute属性必须为true。

但是您已经将UseShellExecute设置为false

© www.soinside.com 2019 - 2024. All rights reserved.