How to extract zip file using dotnet framework 4.0 without using third party dlls [closed] How to extract zip file using dotnet framework 4.0 without using third party dlls [closed] windows windows

How to extract zip file using dotnet framework 4.0 without using third party dlls [closed]


In .NET framework 4.5 now there is System.IO.Compression.ZipFile.ExtractToDirectory(String, String) method.


I'm not sure if it's still available in VS2010, but in earlier versions J# was included in VS and J# includes the java.util.zip class in the vjslib.dll, and since it's part of VS, it's not a third party DLL so you might be able to do it that way.

Here's a CodeProject article showing how to do this: Zip and Unzip from a C# program using J# runtime


There is no "good" way to do this. You could obviously implement the ZIP algorithm yourself using publicly available information on the ZIP file structure and classes such as DeflateStream (though even this may not work if it is not compressed using the DEFLATE algorithm). There is some information on possible alternatives in this blog post, but the short version is that you will either have to use a third-party library or re-write one yourself.

If this is a situation where you would be able to release the source code in a GPL'd manner, you could copy-paste the code from a project like SharpZipLib into your own, thereby sidestepping the requirement to use the DLL. Other than that, though, why can't you use third-party DLLs?