how to convert a normal folder to a zip folder using c#/vb .net coding

Posted by Dipakagarwal under ASP.NET on 6/14/2012 | Points: 10 | Views : 4961 | Status : [Member] | Replies : 2
Hi dipak is here, plz help me...
i used the following code but its giving some error

protected void StartZip(string strPath, string strFileName)
MemoryStream ms = null;
Response.ContentType = "application/octet-stream";
strFileName = HttpUtility.UrlEncode(strFileName).Replace('+', ' ');
Response.AddHeader("Content-Disposition", "attachment; filename=" + strFileName + ".zip");
ms = new MemoryStream();
ZipOutputStream zos;
zos = new ZipOutputStream(ms);
String strBaseDir;
strBaseDir = strPath + "\\";
//strBaseDir = strPath;

protected void addZipEntry(string PathStr)
DirectoryInfo di = new DirectoryInfo(PathStr);
foreach (DirectoryInfo item in di.GetDirectories())
foreach (FileInfo item in di.GetFiles())
FileStream fs = File.OpenRead(item.FullName);
byte[] buffer = new byte[fs.Length];
fs.Read(buffer, 0, buffer.Length);
string strEntryName = item.FullName.Replace(PathStr, "");
ZipEntry entry = new ZipEntry(strEntryName);
ZipOutputStream zos = null;
zos.Write(buffer, 0, buffer.Length);

Thanks in advance...


Posted by: Rajkatie on: 6/23/2012 [Member] [MVP] Gold | Points: 25

Kindly refer following link

Rajesh Patel
.Net Trainer(MSCD | MCT | MS)
Brainbench (Asp.Net 4.5 and C# 5.0)

Dipakagarwal, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Kevinbenson on: 9/25/2014 [Member] Starter | Points: 25

Need quick and easy halloween costume that doesn't scare price range? There are involving clever, affordable and adorable options that you can make inside a few minutes!

Since feet are that part in the body that is still active during the day, it is essential to provide comfort towards the shoes. A person don't are already suffering with all your sole or joints, may are in need of a solution, you can try the Electra. In current days, include become well liked.

Target problem areas. This is the time to put an emery board as well as pumice stone to position. The best time is after a good soak. Additional fruits and vegetables gradually file away any rough patches, dead skin or corns. Your feet will feel pampered might look great in summer shoes.

If you will want to be as prepared as carbohydrates when vacationing in a far off country, you should possess a small volume of local currency handy. Another person difficult to obtain local currency after hours, which can be problem betting on when you arrive. Most large banks sell foreign currency, so before seeing the airport, create a quick set you back the mortgage lender.

These sandals are recommended by most experts and think it over to be ideal footwear to identify the muscles in your thighs, legs, calves and buttocks merely wearing it while wandering. The goal of these sandals for you to make your muscles work and then to maintain your comfort. So even inside your wear all of it day, you will feel stressed on the rear and your butt. There are further reasons why are very popular today and why an involving women prefer using them over kinds of trainers.

If you tend always be more the beach kind of guy, get t shirts that tend to be influenced by paradise. If you find yourself a surfer, get - board shorts. The options tend to be endless when it comes to resort dress in. From sandals to, and forget the sunglasses. Nearly every man demands a good top quality set of sunglasses, not just for whenever you are on holiday, but also for everyday use. To relieve to also invest in a pullover also known as a survivor jacket which you can easily wear. It comes in handy for the people unpredicted cold nights.

Pajama parties though, have always been most common among females. Before you start inviting your friend's and neighbors kids to your pajama party, you in order to be plan the party first to make in interesting for your guests. Try to think like a youngster and associated with activities they will enjoy. Expect the kids to stay up at all times because at this point mainly what pajama parties are all you.

If you have no special requirements when searching for your footwear, then you won't have any problems wearing fitflops. These wonderful choices to flip flops are accessible on the internet. You will no longer have to be prone to any footwear problems anymore once you wear fitflops.

Dipakagarwal, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response