我有我的應用程序觸發帶有特定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()」。 –