Find Code:
All Words
Any of the Words
Exact Phrase
Home
:
Code
:
Forums
:
Submit
:
Mailing List
:
About
:
Contact
Code
All
VB.NET
ASP.NET
C#
VB Classic
ASP Classic
Snippets
Popular
Resources
Submit Code
Forums
Articles
Tips
Links
Books
Contest
Link to us
Download a file from web server
Author:
Dataflow System
E-mail:
Click to e-mail author
Submitted:
12/23/2013
Version:
VB 2010
Compatibility:
VB 2010, VB 2012
Category:
Internet Programming
Views:
5299
Code for downloading a file from web server. Please check our new game "Steer It" in Android Version. https://play.google.com/store/apps/details?id=com.DataflowSystem.SteerIt3D
Declarations:
'none
Code:
This code is useful. You can break your file path from URL using the following code. Private Function TrimFileNameFromFullPath(ByVal FullPath As String) As String Return Path.GetFileName(FullPath).ToString() End Function Private Sub DownloadFile(ByVal Rootpath As String, ByVal Filename As String) Try Dim remoteUri As String = Rootpath Dim myStringWebResource As String = Nothing Dim myWebClient As New WebClient() myStringWebResource = remoteUri + Filename myWebClient.DownloadFile(myStringWebResource, txtSavePath.Text.ToString() & "\" & Filename) Catch ex As Exception MessageBox.Show(Rootpath & "/" & Filename & " Is Invalid Path Of a File") End Try End Sub
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2024 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement