技术开发 频道

用c#关闭windows进程

 

【IT168技术文档】

    用c#关闭进程

 C# code

Process p = new Process();

 p.StartInfo.FileName = "cmd.exe";

 p.StartInfo.Arguments = "/c explorer.exe";

 p.StartInfo.UseShellExecute = false;

 p.StartInfo.RedirectStandardInput = true;

 p.StartInfo.RedirectStandardOutput = true;

 p.StartInfo.RedirectStandardError = true;

 p.StartInfo.CreateNoWindow = true;

 p.Start();

 p.StandardInput.WriteLine("exit");
 

 

 

0
相关文章