Creating zip files from visual studio 2010

I have a series of directories that have a common sub-directory named say commondir
IE:
2011
         bc34567
                          commondir
                                                file 1          
                                                file 2
                                                file2
         cv9845
                          commondir
                                                file 1          
                                                file 2
                                                file2
2012
         bc34511
                          commondir
                                                file 1          
                                                file 2
                                                file2
         cv81345
                          commondir
                                                file 1          
                                                file 2
                                                file2

What I want to do in VS write a prog that will allow user to select a top directory ie:2011 or 2012 then using the directory name of first level down create a zip file by that name if there is a sub-directory named "WEBC" and zip all files in that "WEB" directory.
This will create a new zip for each first level sub-directory and populate it with the contents of "WEBC' directory


2011
         bc34567
                          commondir
                                                file 1          
                                                file 2
                                                file 34

a zip file named bc34567.zip that contains file 1, file 2, file 3.
Jeff_KingstonAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Imran Javed ZiaConsultant Software Engineer - .NET ArchitectCommented:
Hi,

There are many third party libraries which provide features to zip content in dot net. Hope you can achieve your requirements very easily with SharpZipLib  by icsharpcode.

Please refer to following url for more details and samples:
https://github.com/icsharpcode/SharpZipLib/wiki/Zip-Samples

Thanks
0
CodeCruiserCommented:
You can use System.IO.Directory.GetDirectories function to get a list of matching directories

https://msdn.microsoft.com/en-us/library/ms143314(v=vs.110).aspx
0
Jeff_KingstonAuthor Commented:
Maybe I haven't described the stucture

path to base for search is w:     which is     \\nas-dk-01\d:\mcle_departments\products\seminars

I want to select a folder for the year  ex 2011,  2012,  2013 etc

In the year folder there will be folders for each program Fro example "BC345 Contract Law issues"

Then I want to search all subolders in that program folder for a folder named  "Webcast"

If there is a WEBCAST folder create a zip  ex: "BC345 Contract Law issues" and populate it with the files in the webcast folder, saving the file in a folder named          

"2011webzips" under the year folder
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

CodeCruiserCommented:
Yes understood the question. You year folder will be the base directory for search.
0
Jeff_KingstonAuthor Commented:
Code Cruiser,

If I create a vs/vb2010 project and use the code provided, it displays no folders or files?
0
CodeCruiserCommented:
Can you show the code you are using?
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Jeff_KingstonAuthor Commented:
Nothing provided solved the issue
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.