Posted in 面试题 onOctober 01, 2016
代码如下:
if (System.Diagnostics.Process.GetProcessesByName(“Listener”).Length == 0)
{
ProcessStartInfo startInfo = new ProcessStartInfo(“C:\\Sandbox\\Remoting\\Solution\\ICADemo\\ICADemoListener\\bin\\Debug\\Listener.exe”);
startInfo.WindowStyle = ProcessWindowStyle.Normal;
startInfo.CreateNoWindow = true;
startInfo.WorkingDirectory = “C:\\Sandbox\\Remoting\\Solution\\ICADemo\\ICADemoListener\\bin\\Debug”;
System.Diagnostics.Process.Start(startInfo);
}
if (System.Diagnostics.Process.GetProcessesByName(“Listener”).Length == 0)
{
ProcessStartInfo startInfo = new ProcessStartInfo(“C:\\Sandbox\\Remoting\\Solution\\ICADemo\\ICADemoListener\\bin\\Debug\\Listener.exe”);
startInfo.WindowStyle = ProcessWindowStyle.Normal;
startInfo.CreateNoWindow = true;
startInfo.WorkingDirectory = “C:\\Sandbox\\Remoting\\Solution\\ICADemo\\ICADemoListener\\bin\\Debug”;
System.Diagnostics.Process.Start(startInfo);
}
C#实现启动一个进程
声明:登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。
Tags in this post...
Reply on: @reply_date@
@reply_contents@