110,534
社区成员
发帖
与我相关
我的任务
分享
Process[] processes = Process.GetProcesses();
foreach (Process p in processes)
{
if (p.ProcessName.ToLower() == "iexplore.exe")
{
p.Kill();
}
}
这个直接复制到VS2005里就可以用么 直接用DOS命令终止ie进程就行了Process p = new Process(); p.StartInfo.FileName = "cmd.exe"; //调用命令cmd.exep.StartInfo.UseShellExecute = false;p.StartInfo.RedirectStandardInput = true;p.StartInfo.RedirectStandardOutput = true;p.StartInfo.CreateNoWindow = true; ; //不创建窗口p.Start();p.StandardInput.WriteLine("shutdown -s -t 时间"); //自动关机p.StandardInput.WriteLine("exit");p.WaitForExit();p.Close();
直接用DOS命令终止ie进程就行了Process p = new Process(); p.StartInfo.FileName = "cmd.exe"; //调用命令cmd.exep.StartInfo.UseShellExecute = false;p.StartInfo.RedirectStandardInput = true;p.StartInfo.RedirectStandardOutput = true;p.StartInfo.CreateNoWindow = true; ; //不创建窗口p.Start();p.StandardInput.WriteLine("shutdown -s -t 时间"); //自动关机p.StandardInput.WriteLine("exit");p.WaitForExit();p.Close();
Process p = new Process(); p.StartInfo.FileName = "cmd.exe"; //调用命令cmd.exep.StartInfo.UseShellExecute = false;p.StartInfo.RedirectStandardInput = true;p.StartInfo.RedirectStandardOutput = true;p.StartInfo.CreateNoWindow = true; ; //不创建窗口p.Start();p.StandardInput.WriteLine("shutdown -s -t 时间"); //自动关机p.StandardInput.WriteLine("exit");p.WaitForExit();p.Close();
直接用DOS命令终止ie进程就行了