所以我有个问题
Process.Start
始终显示窗口,即使我有属性
CreateNoWindow = true
,
UseShellExecute = false
和
RedirectStandardOuput = true
。在所有的教程和网站上,他们都说这是一种方法。那么我在这里错过了什么?
public static void StartExporter(string part, string path)
{
var startInfo = new ProcessStartInfo();
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
startInfo.CreateNoWindow = true;
startInfo.Verb = "runas";
startInfo.UseShellExecute = false;
startInfo.RedirectStandardOutput = true;
startInfo.FileName = "cmd.exe";
startInfo.Arguments = "/k PartInfoExporter " + part + " " + path;
var process = Process.Start(startInfo);
process.WaitForExit();
}
谢谢你的帮助