我正在搜索是否可以检查某个网站是否有例如google.com在IE中打开。我已经有了这个代码,但它仅用于检查IE是否已打开并关闭它,但它无效。
Dim processCollection() As Process
processCollection = Process.GetProcessesByName("iexplore.exe")
If processCollection.Count > 0 Then
For Each process As Process In processCollection
process.Dispose()
Next
Return False
Else
MessageBox.Show("Ie is now close", "IE")
End If
感谢您的帮助
答案 0 :(得分:2)
请按照以下步骤操作
答案 1 :(得分:0)
Function InternetExplorerRunning()
For Each ie As InternetExplorer In New ShellWindows()
Dim OpenWebsite As String
OpenWebsite = ie
If OpenWebsite = "google.com" Then
MsgBox("Google is open")
End If
Next
End Function
此代码位于计时器中。