Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: VB7
Expertise: beginner
Mar 10, 2003

DownloadFile - Downloading and saving the file at the specified URI

' Downloads the file at the specified URI, and saves it where specified
Sub DownloadFile(ByVal uri As String, ByVal destFile As String, _
    Optional ByVal username As String = Nothing, Optional ByVal pwd As String = _
    Nothing)
    Dim wc As New System.Net.WebClient()
    If Not username Is Nothing AndAlso Not pwd Is Nothing Then
        wc.Credentials = New System.Net.NetworkCredential(username, pwd)
    End If

    wc.DownloadFile(uri, destFile)
End Sub
Marco Bellinaso
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date