| 发表于:2007-04-17 10:44:531楼 得分:0 |
问题解决: private declare function internetopen lib "wininet.dll " alias "internetopena " ( _ byval sagent as string, byval laccesstype as long, _ byval sproxyname as string, byval sproxybypass as string, _ byval lflags as long) as long private declare function internetopenurl lib "wininet.dll " alias "internetopenurla " ( _ byval hinternetsession as long, byval surl as string, _ byval sheaders as string, byval lheaderslength as long, _ byval lflags as long, byval lcontext as long) as long private declare function internetreadfile lib "wininet.dll " ( _ byval hfile as long, byval sbuffer as string, _ byval lnumbytestoread as long, _ lnumberofbytesread as long) as integer private declare function internetclosehandle lib "wininet.dll " ( _ byval hinet as long) as integer private const internet_flag_no_cache_write = &h4000000 dim s private function geturlfile(sturl as string) as string dim lginternet as long, lgsession as long dim stbuf as string * 1024 dim inres as integer dim lgret as long dim sttotal as string sttotal = vbnullstring lgsession = internetopen( "vbtagedit ", 1, vbnullstring, vbnullstring, 0) if lgsession then lginternet = internetopenurl(lgsession, sturl, vbnullstring, _ 0, internet_flag_no_cache_write, 0) if lginternet then do inres = internetreadfile(lginternet, stbuf, 1024, lgret) if (lgret = 1024) then sttotal = sttotal & stbuf else sttotal = sttotal & strconv(leftb$(strconv(stbuf, vbfromunicode), lgret), vbunicode) end if loop while (lgret <> 0) ' end if inres = internetclosehandle(lginternet) end if geturlfile = sttotal end function private sub command1_click() debug.print geturlfile( "http://www.163.com ") end sub | | |
|