'引用"Microsoft Internet Controls" (Shdocvw.dll) and "Microsoft HTML Object Library" (Mshtml.dll) Dim objs() Dim SWs As New SHDocVw.ShellWindows Dim IE As SHDocVw.InternetExplorerPrivate Sub Form_Load() Dim Doc List1.Clear List2.Clear Dim i As Integer i = SWs.Count ReDim objs(i)
i = -1
For Each IE In SWs
List1.AddItem IE.LocationName
i = i + 1 Set objs(i) = IE
Set Doc = IE.Document If TypeOf Doc Is HTMLDocument Then List2.AddItem Doc.URL End If Next End SubPrivate Sub List2_dblClick() Dim i As Integer
On Error Resume Next i = List2.ListIndex objs(i).Quit
List2.RemoveItem i End Sub在List2所列即为IE当前打开的URL,按照你的要求把这些URL按照List2_dblClick的操作结束这些URL所在的IE窗口
放弃吧,换成用防火墙的方法 人家用netscape甚至用腾讯、real player、windows media player的时候这种方法都处理不了 不过推荐是在网关装Microsoft ISA server,不用写代码
对用防火墙winroute(也是路由软件),把80端口一关就打不开网页了
我是新手啊,如何 '引用"Microsoft Internet Controls" (Shdocvw.dll) and "Microsoft HTML Object Library" (Mshtml.dll)???
做BHO(Browser Helper Objects) MSDN 有帮助 ,题目叫Browser Helper Objects: The Browser the Way You Want It 不过都是使用ATL来实现的 VB很难实现
Dim objs()
Dim SWs As New SHDocVw.ShellWindows
Dim IE As SHDocVw.InternetExplorerPrivate Sub Form_Load()
Dim Doc
List1.Clear
List2.Clear
Dim i As Integer
i = SWs.Count
ReDim objs(i)
i = -1
For Each IE In SWs
List1.AddItem IE.LocationName
i = i + 1
Set objs(i) = IE
Set Doc = IE.Document
If TypeOf Doc Is HTMLDocument Then
List2.AddItem Doc.URL
End If
Next
End SubPrivate Sub List2_dblClick()
Dim i As Integer
On Error Resume Next
i = List2.ListIndex
objs(i).Quit
List2.RemoveItem i
End Sub在List2所列即为IE当前打开的URL,按照你的要求把这些URL按照List2_dblClick的操作结束这些URL所在的IE窗口
人家用netscape甚至用腾讯、real player、windows media player的时候这种方法都处理不了
不过推荐是在网关装Microsoft ISA server,不用写代码
'引用"Microsoft Internet Controls" (Shdocvw.dll) and "Microsoft HTML Object Library" (Mshtml.dll)???
不过都是使用ATL来实现的 VB很难实现