Private Declare Function URLOpenStream Lib "urlmon" _
Alias "URLOpenStreamA" _
(ByVal pCaller As Long, _
ByVal szURL As String, _
ByVal content As String, _
ByVal dwReserved As Long, _
ByVal lpfnCB As Long) As Long
Private Sub Command1_Click()
Dim content As Variant
URLOpenStream 0, "http://www.sohu.com", content, 0, 0
MsgBox content
End Sub
Private Declare Function URLDownloadToFile Lib "urlmon" _
Alias "URLDownloadToFileA" _
(ByVal pCaller As Long, _
ByVal szURL As String, _
ByVal szFileName As String, _
ByVal dwReserved As Long, _
ByVal lpfnCB As Long) As Long
Private Sub Command1_Click()
URLDownloadToFile 0, "http://office.9zp.com/index.asp", "c:\test.txt", 0, 0
End Sub
试试这个
加入timer,commandbutton,text
private sub command1_click()
webbrowser1.navigate http://www.sohu.com/
timer1.enabled=true
end sub
private sub timer1_timer()
dim doc,objhtml as object
dim i as integer
dim strhtml as string
if not webbrowser1.busy then
set doc=webbrowser1.document
i=0
set objhtml=doc.body.createtextrange()
if not isnull(objhtml) then
text1.text=objhtml.htmltext
end if
timer1.enabled=false
end if
end sub