请问高手。怎么用程序实现保存网页??????

zjn12 2003-10-16 08:41:51
如题?请问高手。怎么用程序实现保存网页??????
...全文
78 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
hhjjhjhj 2003-10-16
  • 打赏
  • 举报
回复
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()
sourceUrl = "http://xxx.com/yy.htm"
targetFile = "c:\deleteme.htm"
URLDownloadToFile(0&, sourceUrl, targetFile, 0&, 0&)
End Sub
online 2003-10-16
  • 打赏
  • 举报
回复
加入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

得到网页源吗后,再saveas成html格式

1,502

社区成员

发帖
与我相关
我的任务
社区描述
VB 网络编程
社区管理员
  • 网络编程
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧