相关疑难解决方法(0)

在C#中以编程方式杀死进程树

我以编程方式启动Internet Explorer,代码如下所示:

ProcessStartInfo startInfo = new ProcessStartInfo("iexplore.exe");
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
startInfo.Arguments = "http://www.google.com";
Process ieProcess = Process.Start(startInfo);
Run Code Online (Sandbox Code Playgroud)

这将生成Windows任务管理器中可见的2个进程.然后,我尝试用以下方法终止进程:

ieProcess.Kill();
Run Code Online (Sandbox Code Playgroud)

这导致任务管理器中的一个进程被关闭,另一个进程仍然存在.我尝试检查任何具有子进程的属性,但没有找到.我怎么能杀死其他进程呢?更一般地说,如何杀死与Process.Start开始的进程相关的所有进程?

.net c# kill-process

40
推荐指数
6
解决办法
4万
查看次数

如何从Powershell访问正在运行的Internet Explorer实例的经典Internet Explorer COM自动化对象?

如何为正在运行的Internet Explorer实例访问经典Internet Explorer COM自动化对象?也就是说,如果我在多个窗口中打开Internet Explorer,如何在Powershell中将与其中一个窗口对应的COM对象与Powershell中的变量相关联?我最接近这样做的是通过get-process获取进程"iexplore"和"ieuser".

com powershell internet-explorer dom

3
推荐指数
1
解决办法
2573
查看次数

标签 统计

.net ×1

c# ×1

com ×1

dom ×1

internet-explorer ×1

kill-process ×1

powershell ×1