PrintUrlToFile function

From StealthBot Wiki
Jump to: navigation, search

The PrintUrlToFile function is provided by the Script Support Class to StealthBot to expose the UrlDownloadToFile() API function to scripting.

Development

The PrintUrlToFile function was added in version 2.6 as suggested by FiftyToo.

Documentation

'// PRINTURLTOFILE
'// Mirror function for the Windows API URLDownloadToFile() function
'// Currently you are restricted to placing files in the StealthBot install directory only
Public Sub PrintURLToFile(ByVal sFileName As String, ByVal sURL As String)

    sFileName = StringFormat("{0}\{1}", CurDir$(), sFileName)

    URLDownloadToFile 0, sURL, sFileName, 0, 0

End Sub

Summary

This function calls the API function URLDownloadToFile in order to download the file from the URL to the specified file name. Use this to download a file to the location specified by the BotPath function.

Syntax

PrintUrlToFile FileName, URL

Arguments

  • sFileName is the name of the file to be downloaded to.
  • sURL is the URL to remove cached entries for.

Examples

  • Download some file to your bot folder wihtout caching.
  • sUrl = "http://stealthbot.net/sb/bnls.php"
    DeleteUrlCache CStr(sUrl)
    PrintUrlToFile "bnls_servers.txt", CStr(sUrl)
    

See also