HOT SUMMER 每天都是不一样,积极的去感受生活 C#关闭IE相应的窗口 .
window.close();
System.Diagnostics.Process[] myProcesses;
myProcesses = System.Diagnostics.Process.GetProcessesByName("IEXPLORE");
foreach (System.Diagnostics.Process instance in myProcesses)
{
instance.CloseMainWindow();
}
instance.kill();
Process[] pros = System.Diagnostics.Process.GetProcessesByName("IEXPLORE");
foreach(Process p in pros)
{
if(p.MainWindowTitle.Equals("YourTitleSetting"))
p.Kill();
}
- //关闭所有的IE
- System.Diagnostics.Process[] myProcesses;
- myProcesses = System.Diagnostics.Process.GetProcessesByName("IEXPLORE");
- foreach (System.Diagnostics.Process instance in myProcesses)
- {
- instance.CloseMainWindow();
- }
- instance.kill();
- //关闭标题为你要求的IE
- Process[] pros = System.Diagnostics.Process.GetProcessesByName("IEXPLORE");
- foreach (Process p in pros)
- {
- if (p.MainWindowTitle.Equals("YourTitleSetting"))
- p.Kill();
- }