hi,

i am doing a project using C#. i am new to this area.

the task is to extract the zip or rar file using C#.

in my windows form have a text box and button in the form. i will give the zip or rar file. when i click that button. it must automatically extract the file and shows contents of that file in to the other form or file..

i don't know how to extract that zip or rar file using C#.

if u know please share your idea.

You need to use

System.IO.Compression namespace.

You need to use

System.IO.Compression namespace.

...But that only handles ZIP files. RAR files will have to be done with something else, like this DLL:

http://www.example-code.com/csharp/rar_unrar.asp

This won't create RAR files, but it will list and extract.

DotNetZip library does a great job with zip files. It is very easy to use, yet very fast and flawless code. RAR files are closed format and we cant manipulate them programatrically.