Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to download files or information from within your app

Using WebClient

How to download files or information from within your app

by  skiflyer  Posted    (Edited  )
In .NET it's incredibly easy to download files from within your application.

The function takes a file name, a url, and a destination directory, and downloads the file from the URL to the destination.

Code:
Public Sub GetPackage(ByVal sFile As String, ByVal destination As String, ByVal sRemoteUrl As String)
  Dim wc As New Net.WebClient()
  Try
    wc.DownloadFile(sRemoteUrl + sFile, destination + "\\" + sFile)
  Catch
    MsgBox("Unable to download file " + sRemoteUrl + sFile)
  End Try
End Sub


Good luck and enjoy.
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top