It’s easy with XCeed ZIP component

I was on a lookout for a good component which automatically extracts a ZIP file located on the server. Finally, I found Xceed ZIP for .NET, which performs the task with only few lines of code. I managed to unzip even a file with 5 MB in size very easily. I’m posting a tutorial with code snippet to illustrate how easy it is to unzip a ZIP file. Please note that you should ZIP the file using WINZIP.


You can easily extract the contents of a ZIP file on the server by following the steps given below.


Please note that in order to work with the example you should install XCeed ZIP for .NET which is available for download (45 days trial) from http://xceed.com/Zip_Net_Whatsnew.html


Step – 1


Copy the following DLL’s to the BIN directory of your website. If there is no such directory, then you can create it


Xceed.Compression.dll
Xceed.Compression.Formats.dll
Xceed.FileSystem.dll
Xceed.Zip.dll


You can locate these DLL files from Program Files\Xceed Components\Bin\.NET folder


Step – 2


Add the following code to the Page_Load() event


Try
Xceed.Zip.Licenser.LicenseKey = “ZINXX-XXXXX-XXXXX-XXXX”
Dim zip As New ZipArchive(New DiskFile(Server.MapPath(“.”) & “\Test.zip”))
Dim folder As New DiskFolder(Server.MapPath(“.”))
zip.CopyFilesTo(folder, True, True)
Response.Write(“Files Unzipped Successfully”)
Catch err As Exception
Response.Write(err.Message)
Finally
End Try


That’s it. Execute the file and you will see a message “Files Unzipped Successfully“. You should see a new folder named Test with the required file inside the root of your domain.


Please make sure to upload Test.Zip into the root directory before attempting to run the project


 

Remembering Longhorn

I had contributed two part article for Developer.com about Longhorn long time back when it was in early alpha stages. I remember the day in which I received around 12 white CD’s containing Longhorn.


Longhorn Coming Attractions – Part 1


Longhorn Coming Attractions – Part 2


I’ve posted the links for the benefit of the community. I look forward to write articles like this after the receipt of Windows Vista next year which is just 5 hours away. I’m expecting it shortly.

Acer Laptop for bloggers

Microsoft shipped laptops free of cost for few bloggers. I didn’t got any laptop or any communication regarding this but I would love to write a review about Windows Vista at various sites if I get one. In fact, I’ve written a book titled Community Server Quickly as well. I hope I will get this cool laptop one day so that I can post a review about Windows Vista here.


I’m wondering about the selection criteria and how Microsoft picked the e-mail addresses to contact the bloggers for shipping the laptop.

Amazon.com Issue Fixed

My book (Community Server Quickly) page at Amazon.com now displays the correct pricing along with its Availability. It took over 1 month to fix the issue. However, there are no discounts available from Amazon.com. There is some discount available for my book at Amazon.co.uk.


If you want to purchase my book at a huge discounted price then please visit BarnesandNobles.com or purchase directly from Packt Publishing.


I will update the book website with all purchase options soon.

Author Copies in Hand

Today, I received 5 copies of my book from Packt Publishing in a big giant box filled with packing papers. The book looks really nice and cool. Everything is perfect inside the book. I hope my book will help readers to learn more.


I’m waiting for the amazon to fix the price issue on their site and also to activate Amazon’s Connect page. I’m also waiting to read the reviews posted by reviewers. I’m sure things will become really hot after New Year.