README.md

December 5, 2022 ยท View on GitHub

Ghost A Download

Description

This code downloads anything off the internet without popping up a dialog box of any sort. Very simple to use. Vote if ya wanna.

More Info

Don't forget about the declarations.

Submitted On
ByCovertLoop
LevelBeginner
User Rating5.0 (15 globes from 3 users)
CompatibilityVB 4.0 (16-bit), VB 4.0 (32-bit), VB 5.0, VB 6.0
CategoryCoding Standards
WorldVisual Basic
Archive File

API Declarations

Private Declare Function URLDownloadToFile Lib "urlmon" Alias _
  "URLDownloadToFileA" (ByVal pCaller As Long, _
  ByVal szURL As String, _
  ByVal szFileName As String, _
  ByVal dwReserved As Long, _
  ByVal lpfnCB As Long) As Long
Public Function DownloadFile(URL As String, _
  LocalFilename As String) As Boolean
  Dim lngRetVal As Long
  lngRetVal = URLDownloadToFile(0, URL, LocalFilename, 0, 0)
  If lngRetVal = 0 Then DownloadFile = True
End Function

Source Code

G = DownloadFile("UrlOfTheFileToDownload", "c:\windows\desktop\FileName.htm")