In this post, I will demonstrate how easy it is to download a file from a web server to your local hard drive. In most scenarios, you may browse the net using your web browser and click on a hyperlink to start a downloading of a file from a remote site.
Some of you may be interested in how to download this using their application code using Dot Net.
This can be very easily achieved using the WebClient class under System.Net namespace.
First, import the System.Net namespace.
using System.IO;
The above LOC will do so.
Now, create an instance of WebCleient class.
WebClient client = new WebClient();
Now, call the DownloadFile method
client.DownloadFile(<url>, @"<fileDestinationName>.<filetype>");
Have fun. Cheers !!!!
skip to main |
skip to sidebar
Labels
Blogumulus by Roy Tanck and Amanda Fazani
Labels
- .NET (2)
- addressbar icon (1)
- arrays (1)
- ASP (2)
- Browse Folder (1)
- Browser (1)
- browser icon (1)
- build network monitoring tool (1)
- build snmp tool (1)
- Build your own Network sniffer (1)
- C Sharp (2)
- C# (2)
- Chat Application (1)
- comparable (1)
- Connect (1)
- Connect MySQL NetBeans (1)
- custom sort (1)
- Date Format (1)
- DOT NET (7)
- Download (1)
- Encrypt image (1)
- Encrypt picture (1)
- favicon (1)
- File (2)
- file download (1)
- flush method (1)
- FolderBrowseDialog (1)
- Formatter (1)
- icon (1)
- IO (1)
- J2ME mail (1)
- Janaka Perera (1)
- Java (5)
- Java Buffered Writer issues (1)
- Java Encryption (1)
- java runtime (1)
- java snmp (1)
- java Twitter (1)
- Mobile E-Mail (1)
- My Server (1)
- MySQL (1)
- NetBeans (1)
- network sniffer (1)
- network traffic analyzer (1)
- new line (1)
- Off The Record (1)
- OOP explanation (1)
- OTR (1)
- Protocol (1)
- Regex (3)
- Regular Expressions (3)
- run application from java (1)
- run executable java programme (1)
- Send email (1)
- sniffer (1)
- SNMP (1)
- snmp monitor tool (1)
- snmp tool (1)
- sort (1)
- sort array (1)
- splitting csv (1)
- sql array (1)
- sql server (1)
- System.out.println (1)
- System.out.println() (1)
- tribute Janaka Perera (1)
- Twitter (1)
- Twitter API (1)
- URL (1)
- url validator (1)
- validator (1)
- WebClient (1)
- writing output to file (2)
Back on top ^
created by Nuvio | Webdesign
Ruchira's Blog © 2008 Ken ahlin | Converted to XML Blogger Template by ThemeLib