當前位置:編程學習大全網 - 源碼下載 - 怎麽有VB編程實現獲取IE瀏覽器彈出窗口中的內容

怎麽有VB編程實現獲取IE瀏覽器彈出窗口中的內容

能的 Dim dWinFolder As New ShellWindows

Dim WithEvents eventIE As WebBrowser_V1

Private Sub Command1_Click()

Dim objIE As Object

For Each objIE In dWinFolder

If objIE.LocationURL = List1.List(List1.ListIndex) Then

Set eventIE = objIE

Command1.Enabled = False

List1.Enabled = False

Text1.Text = ""

Exit For

End If

Next

End Sub

Private Sub eventIE_NavigateComplete(ByVal URL As String)

Text1.Text = Text1.Text + Chr(13) + Chr(10) + URL

End Sub

在運行前。點擊菜單 Projects ? References 項,在Available References 列表中選擇Microsoft Internet Controls項將Internet對象引用介入到工程中

Private Sub Form_Load()

Dim objIE As Object

For Each objIE In dWinFolder

If InStr(1, objIE.FullName, "IEXPLORE.EXE", vbTextCompare) <> 0 Then

List1.AddItem objIE.LocationURL

End If

Next

Command1.Caption = "正文"

End Sub

Private Sub Form_Unload(Cancel As Integer)

Set dWinFolder = Nothing

End Sub

Private Sub List1_Click()

Dim objDoc As Object

Dim objIE As Object

For Each objIE In dWinFolder

If objIE.LocationURL = List1.List(List1.ListIndex) Then

Set objDoc = objIE.Document

For i = 1 To objDoc.All.length - 1

If objDoc.All(i).tagname = "BODY" Then

Text1.Text = objDoc.All(i).innerText

End If

Next

Exit For

End If

Next

End Sub

  • 上一篇:RGBAND指示器源代碼
  • 下一篇:c語言中如何產生壹定比例的隨機數?
  • copyright 2024編程學習大全網