如何启动程序隐藏? [英] How to start Process hidden?

查看:272
本文介绍了如何启动程序隐藏?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始通过的ProcessStartInfo和的Process.Start(控制台应用程序)。我想隐藏的黑色窗口。这里是我的code:

 字符串输出=;
//设置与类的ProcessStartInfo进程
的ProcessStartInfo的StartInfo =新的ProcessStartInfo();
startInfo.FileName =C:\\\\ WINNT \\\\ SYSTEM32 \\\\的cmd.exe
startInfo.UseShellExecute = FALSE;
startInfo.RedirectStandardOutput =真;//启动过程
流程PROC =的Process.Start(StartInfo的);


解决方案

试试这个:

  startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;

I start a Console Application via ProcessStartInfo and process.Start(). I want to hide the black window. Here's my code:

string output = "";
//Setup the Process with the ProcessStartInfo class
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.FileName = "C:\\WINNT\\system32\\cmd.exe";
startInfo.UseShellExecute = false;
startInfo.RedirectStandardOutput = true;

//Start the process
Process proc = Process.Start(startInfo);

解决方案

Try This:

startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;

这篇关于如何启动程序隐藏?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆