2,749
社区成员
发帖
与我相关
我的任务
分享Local lcRemoteUrl,lcRemoteFile,lcLocalhtm,lcLocalFile
Declare Integer DeleteUrlCacheEntry In Wininet.Dll String szUrl
Declare Integer URLDownloadToFile In urlmon.Dll Integer pCaller,String szURL,String szFileName,Integer dwReserved,Integer lpfnCB
*--下载网页
lcRemoteUrl="http://www.AAA.com/XXX.asp?dm=123&sl=32.1"
lcLocalhtm="c:\xxx.htm"
=DeleteUrlCacheEntry(lcRemoteUrl) &&清理缓存,这对实时刷新的数据时很有用。
If URLDownloadToFile(0,lcRemoteUrl,lcLocalhtm,0,0)=0
Messagebox("下载成功!",64,'信息提示')
Else
Messagebox("下载失败",48,'信息提示')
Endif然后分析 c:\xxx.htm ,用 Filetostr()将网页转成字符串来分析。Local loIE
loIE=Createobject("InternetExplorer.Application")
lsURL="www.126.com"
loIE.Navigate(lsURL)
Do While loIE.busy Or loIE.readyState <> 4
*Inkey(0.1,"H") && 防止程序失去响应
DoEvents
Enddo
loIE.Visible=.T.
Messagebox('')
loIE.Quit
Release loIE