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();
- }
posted on 2012-05-09 22:34 HOT SUMMER 阅读(3463) 评论(0) 编辑 收藏 举报