我们的C#应用程序将通过执行以下操作启动控制台应用程序 Process correctionProcess = Process.Start(exePath, rawDataFileName);
客户希望隐藏来自其应用程序的控制台窗口.我们可以做到这一点吗?
您可以创建Processwith ProcessStartInfo,其中CreateNoWindow和UseShellExecute属性分别设置为true和false.
ProcessStartInfo startInfo = new ProcessStartInfo(exePath);
startInfo.CreateNoWindow = true;
startInfo.UseShellExecute = false;
startInfo.Arguments = rawDataFileName;
Process.Start(startInfo);
Run Code Online (Sandbox Code Playgroud)