The*_*ask 4 .net c# console hidden winforms
可能重复:
C#:将外部控制台程序运行为隐藏
我正在使用需要启动控制台应用程序的Windows窗体应用程序.我不希望控制台应用程序显示在Windows任务上
我设定 p.WindowStyle = ProcessWindowStyle.Hidden;
但它不起作用,这个过程正在显现
码:
ProcessStartInfo p = new ProcessStartInfo();
p.UseShellExecute = false;
p.RedirectStandardOutput = true;
p.FileName = "rasdial";
p.Arguments = string.Format("\x22{0}\x22", name);
p.WindowStyle = ProcessWindowStyle.Hidden;
Process process = Process.Start(p);
Run Code Online (Sandbox Code Playgroud)
任何帮助,将不胜感激.提前致谢!