简体   繁体   English

启动隐藏进程 C#

[英]Start hidden process C#

Code:代码:

System.Diagnostics.Process.Start("rundll32.exe", "InetCpl.cpl,ClearMyTracksByProcess 4351");

I want start it hidden, how I can do it?我想把它隐藏起来,我该怎么做?

You could set the WindowStyle property to Hidden like this:您可以像这样将WindowStyle属性设置为Hidden

ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.FileName = "rundll32.exe";
startInfo.UseShellExecute = false;
startInfo.RedirectStandardOutput = true;
 startInfo.WindowStyle = ProcessWindowStyle.Hidden;
 //Start the process
 Process proc = Process.Start(startInfo);

Goodluck.祝你好运。

one can do like the code below:可以像下面的代码一样:

 ProcessStartInfo psi = new ProcessStartInfo();
 psi.FileName = ....
 psi.RedirectStandardInput = true;
 psi.RedirectStandardOutput = false;
 psi.Arguments =...
 psi.UseShellExecute = false;
 psi.CreateNoWindow = true; // <- key line

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM