using System.Diagnostics; using System.Threading; class Program { static void Main() { Process process = Process.Start("notepad.exe", "hello.txt"); //创建子进程,初始的进程为父进程 Thread.Sleep(1000);//父进程的线程在等待1秒后,销毁子进程 process.Kill(); } }
using System.Diagnostics; using System.Threading; class Program { static void Main() { Process process = Process.Start("notepad.exe", "hello.txt"); //创建子进程,初始的进程为父进程 Thread.Sleep(1000);//父进程的线程在等待1秒后,销毁子进程 process.Kill(); } }