我要關閉IE窗口時,URL中包含類似的字符串:眼鏡蛇錯誤Citrix服務器上關閉IE窗口用C#
我有這樣的代碼和它的作品我的本地機器上:
foreach (InternetExplorer explorer in new ShellWindowsClass()) {
String url = explorer.LocationURL;
if (url.Contains("cobra")) {
explorer.Quit();
}
}
的IE瀏覽器和該代碼現在Y上的Citrix系統,當使用這種代碼我得到異常:
Retrieving the COM class factory for component with CLSID {9BA05972-F6A8-11CF-A442-00A0C90A8F39} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))
我現在該怎麼辦?
請爲您的答案添加一些解釋,說明它的功能以及如何解決問題。這將有助於其他人在未來看到您的答案 – 2014-09-29 10:00:04
我將其更改爲您的答案,但它沒有關閉窗口或標籤。 – Andrija 2014-09-29 10:25:26
新的ShellWindowsClass()或新的ShellWindows()會拋出異常 – Andrija 2014-10-06 09:17:36