我有我的应用程序触发带有特定URL的Web浏览器。 我的程序结束后,我想关闭我打开的网页/选项卡。如何获取每个选项卡的PID的Internet Explorer选项卡的URL?
通过调用带有参数a的EXE文件。进程名称b。字符串出现在URL
How to kill firefox child process/tab from Java/C++
我用C#方法详细的问题...
我能找到的所有标签的进程ID ..
foreach (Process theprocess in processlist) {
if (theprocess.ProcessName == "iexplore") {
Console.WriteLine("Process: {0}\tID: {1}\tWindow name: {2}",
theprocess.ProcessName, theprocess.Id, theprocess.MainWindowTitle
);
}
}
目前我只能得到过程的窗口标题....并且在IE8中只有主窗口的一个窗口标题可见..
箴言我想我有每个选项卡的pid,如何找到选项卡的URL ...并只杀死该选项卡?
我使用SHDOCVW Access is denied - when trying to get the url (text) from address bar's handle
此帮助; 。 。
foreach(InternetExplorer ieInst in new ShellWindowsClass()) Console.WriteLine(ieInst.LocationURL);
伟大的信息,但是为什么你在说你自己? :o/ –
Coz evryon查看它并且没有任何机构回应:)直到我自己找到解决方案,并共享tat:P –
使用此代码将引发两个错误。应该使用“ShellWindows()”而不是“ShellWindowsClass()”。 –