简体   繁体   English

创建新流程时隐藏窗口

[英]Hide window when creating new process

I am starting a new process with the following code: 我正在使用以下代码开始新的过程:

Process n;
n = Process.Start("D:\\Update");

When the process starts, it is visible on the desktop. 该过程开始时,它在桌面上可见。 Is there any way to ensure that the new process will start in the background? 有什么方法可以确保新流程在后台启动?

ProcessStartInfo startInfo = new ProcessStartInfo()
{
   FileName = "Myapplication.exe",
   WindowStyle = ProcessWindowStyle.Hidden
};

Process process = new Process() { StartInfo = startInfo };

process.Start();

you can pass any arguments using the code below 您可以使用以下代码传递任何参数

process.StartInfo.Arguments = "-a ipaddress -L;" //just an example

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

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