Possible Duplicate:
C#: Run external console program as hidden
I am using a Windows Forms application that needs to start a console app. I don't want the console app be displayed on windows task
I setting p.WindowStyle = ProcessWindowStyle.Hidden;
But it doesn't work, the process is showing
Code:
ProcessStartInfo p = new ProcessStartInfo();
p.UseShellExecute = false;
p.RedirectStandardOutput = true;
p.FileName = "rasdial";
p.Arguments = string.Format("\x22{0}\x22", name);
p.WindowStyle = ProcessWindo开发者_开发知识库wStyle.Hidden;
Process process = Process.Start(p);
Any help would be appreciated. Thanks in advance!
The solution:
p.CreateNoWindow = true;
精彩评论