From: Karl E. Peterson on
jim evans wrote on 1/21/2010 :
> I have used the following function to fetch webpages for a long time
> and in several applications.
>
> hOpenUrl = InternetOpenUrl(hOpen, sUrl, vbNullString, 0, _
> INTERNET_FLAG_RELOAD, 0)
>
> bDoLoop = True
> While bDoLoop
> sReadBuffer = vbNullString
> bRet = InternetReadFile(hOpenUrl, sReadBuffer, _
> Len(sReadBuffer), lNumberOfBytesRead)
> sBuffer = sBuffer & Left$(sReadBuffer, _
> lNumberOfBytesRead)
> If Not CBool(lNumberOfBytesRead) Then bDoLoop = False
> Wend
>
> If hOpenUrl <> 0 Then InternetCloseHandle (hOpenUrl)
> If hOpen <> 0 Then InternetCloseHandle (hOpen)
> OpenURL = sBuffer
>
> End Function
>
> A website I use it with has radically revised their code and this
> function no longer works. It fetches something but not the webpage.
> When I go to the page in a browser and look at the source it looks
> correct and like it used to, but like I said, when I fetch the source
> code I get is not that page.
>
> Does someone know why?

Could be any number of things, but likely it's getting input (cookies,
session variables, etc) that you're not providing. No way to even
guess without seeing what's being returned.

--
..NET: It's About Trust!
http://vfred.mvps.org


 | 
Pages: 1
Prev: Old VB websites
Next: 10TEC Grid