Downloading file and extracting ZIP compressed file with Visual Basic.NET
Posted by Daniel - 1,662 Views
These are a couple examples of many simplified processes provided by the VB.NET. You can’t find these simplicity in its predecessor, the Traditional VB6.
Downloading a file - Believe it or not you only need less than 3 lines to download a file somewhere from the internet to you local drive. This sub procedure below can do that for you, without a reference to any library - it’s a built-in feature:
String)
Dim objDL As New System.Net.WebClient
objDL.DownloadFile(strURL, strSavePath)
End Sub
And the sample procedure call is below. It will download SimpleGridBuilder, one the the averagecoder’s free collection to your C:\ path:
&“wp-content/uploads/simplegridbuilder.zip”, “c:\simplegridbuilder.zip”)
Extracting a zip file - You need vsjlib installed on your system in order to be able to extract a zip file. This library can be found in the distribution of the Visual J#. Installing Visual J# will also install the vsjilib into you IDE.
After you had the vsjlib installed, you can do anything you want with java.util.zip.ZipEntry class. But for simplicity you can find a wrapper class on the internet such as the Matthew Hood’s class - the clsDWDZip.vb.
Do the following steps to include that wrapper class into your project:
- Download the clsDWDZip.vb
- Place it in the same folder of your project files folder
- From the VB.NET IDE, choose [Project]-[Add Existing Item…] Menu then select the clsDWDZip.vb
The following sub procedure can be used to perform ZIP extracting process in collaboration with the clsDWDZip.vb:
Dim objZipFile As New DWDZip.DWDZipFile
objZipFile.FilePath = strSourcePath
objZipFile.Open()
objZipFile.ExtractAllTo(strExtractTo)
End Sub
You can download the example project included in this article or if you need more alternatives, there is also a good information from MSDN. Click here to go there.
Download the example project (65 KB)
__________________________
The following posts are programmatically considered as related to the current post by YARPP Plugin:
- Visual Basic.NET, an example of using HTTPWebRequest object
- Replacing and filtering text with regular expression using Delphi, Visual Basic and ASP
- Visual Basic Version of ASCII-to-PDU and PDU-to-ASCII Converter Functions
- Customizing the PDF file created with ContuttoPDF Wordpress Plugin
- Passing arguments to your VB.NET console application
Related posts brought to you by Yet Another Related Posts Plugin.
Latest from Programming
- Microsoft Excel Import External Data Problem: When Microsoft Query doesn’t recognize some of your parameters
- SmartImageResizer Plugin, WordPress plugin based on Joe Lencioni’s Smart Image Resizer
- Resize Image or Crop Image with Joe Lencioni’s Smart Image Resizer, WordPress Setup
- Free Softwares to help you learn Regular Expression or to enhance your RegEx skill
- ConsoleProgressBar - Simple Progress Bar Function for your VB.Net Console Application
Leave a Reply
Latest Blog Entries
- Sweet Home 3D, a free home design software
- 26x Optical Zoom on a Compact Digital Camera?
- Windows 7 Release Candidate is now available
- Microsoft Excel Import External Data Problem: When Microsoft Query doesn’t recognize some of your parameters
- The Lack of Chances is the Source of Poverty, Can we make a different?
- SmartFTP Client is no longer Free. What would be the best replacement for it?
- Kantaris Media Player, The most suitable Free Media Player on my Audio Environment
Categories
Neighbours and Friends
- Anti Teori
- Busby SEO Test Page
- Deny Sri
- Digital Media Convert
- Freeware Maniac
- Oeroek
- RidhoCyber
- Suraja Web
Comments - Thanks Guys :)
Therese Lachance: Hi, Any idea how to have ContuttoPDF fetch the correct page language?
Marlena Albu: Super Blog, Dude! I am constantly on the watch for new and interesting sites and postings about audio equipment… which is what...
tresloukadu: yo how did u fixed when the tags shows <? and it shows < “& l t ; ” ?? please send me an email.
Sean: This is a great piece of code and thanks for adding the updates. Sean’s last blog post: Not All Text Message Marketing Is Created...
rodhy: Thank for your code, it very usefull for me. best regard.
Most Popular Entries
- Passing arguments to your VB.NET console application
- ConsoleProgressBar - Simple Progress Bar Function for your VB.Net Console Application
- ASCII To PDU Converter (Convert ASCII to PDU and vice versa)
- An example: Using CPort Delphi Component to read data from your cellphone
- Microsoft Excel Import External Data Problem: When Microsoft Query doesn’t recognize some of your parameters
Software Collections
- Sweet Home 3D, a free home design software
- SmartFTP Client is no longer Free. What would be the best replacement for it?
- Kantaris Media Player, The most suitable Free Media Player on my Audio Environment
- TCPView for Windows, Tool to check TCP and UDP Connections on your system
- The Code Snippet Plugin, my favourite syntax highlighter plugin for WordPress
Blogging Related Stuff
- Change the WordPress permalink structure to the best format, and yes it’s a little bit scary :D
- Something is wrong, the Google Search Result from my blog looks bad, don’t laugh please :D
- Several tips to reduce Blog Noise, especially when your blog covers more than one niche
- How to remove your indexed pages or even your entire site from Google and Yahoo!

















