Locating Zip folders
-
Hi, I have to unzip multiple folders present in a single folder using c#. I have the code for doing this and it is working fine. For using this code I have to select the file that is to be unzipped and then after unziping it I have to select the next zip file and unzip it and so on. This is a very long process. Can anyone tell me how to unzip all the zip folders present in the parent folder at one go. thanx Nitin.
Nitin Raj Bidkikar
-
Hi, I have to unzip multiple folders present in a single folder using c#. I have the code for doing this and it is working fine. For using this code I have to select the file that is to be unzipped and then after unziping it I have to select the next zip file and unzip it and so on. This is a very long process. Can anyone tell me how to unzip all the zip folders present in the parent folder at one go. thanx Nitin.
Nitin Raj Bidkikar
You can use Directory.GetFiles method for locating all the zip files and then use your code I think general scheme whould be like this
string[]zipFiles; foreach(string zf in zipFiles) . . . //your code here
hope the post would help -
You can use Directory.GetFiles method for locating all the zip files and then use your code I think general scheme whould be like this
string[]zipFiles; foreach(string zf in zipFiles) . . . //your code here
hope the post would helphey ur soln has helped me........but along with the zip files there are some word documents present....so when the control comes to the word files it is throwing exception.......how do i make the code to ignore the word docs and just unzip the zip files..... thanx nitin
Nitin Raj Bidkikar
-
hey ur soln has helped me........but along with the zip files there are some word documents present....so when the control comes to the word files it is throwing exception.......how do i make the code to ignore the word docs and just unzip the zip files..... thanx nitin
Nitin Raj Bidkikar
you can filter the files with using the overloaded version of the GetFiles(string path,string searchPattern) it would be somewhat like this for zip files
string[] files=System.IO.Directory.GetFiles(path, "*.zip");
good luck