Joe Strazzere - All Things Quality

Visit my new blog at http://strazzere.blogspot.com/


December 1, 2005 - WinTask - DownloadFile$

Posted in WinTask

'
' DownloadFile$ - Download HTML from a URL in the background and put it in a string variable
'
' Author: Joe Strazzere
'

Function DownloadFile$(URL$)
    Local ReturnedString$
    Local TempString$
 Local TempFile$

 TempFile$="c:\jsstemp.txt"

    If Exist(TempFile$) then
      Kill(TempFile$)
    End If

    Write(TempFile$, "URL not found!")

    External("urlmon.dll", "URLDownloadToFileA", 0, URL$, TempFile$, 0, 0)

    SetReadPos(TempFile$,0)
    TempString$=""

    Repeat
      Read(TempFile$, ReturnedString$)
     TempString$ = TempString$ + ReturnedString$
    Until EOF(TempFile$)

    DownloadFile$ = TempString$
EndFunction

'
' try it
'
var$=DownloadFile$("http://www.google.com/intl/en/about.html")
msgbox(var$)



Any comments on this article?
Email Me


<- Last Page :: Next Page ->

About Me

A gathering place for information and ideas about Quality Assurance, Testing, and other useful topics.

Problems cannot be solved by the same level of thinking that created them. - A. Einstein

Search This Site

Translate This Site

RSS Feed

Subscribe

Twitter

@jstrazzere

Categories

Life
QA
Sports
Tools
WinTask
Work in General

What I'm Reading Now