I am new to c#.net using Visual studio 2010 Express. I have got an assignment to create a zip file from the folder which contains image files and some text files. I have been given Ionic.Zip.dll
to use to zip the folder. But i dont know from where to start.
I have created a c# project and a function that takes a path of folder and returns path of .zip
file. I dont know how to add this dll in to my project and how to use it.I have found many code snippets ,but how to start of ...
Following is the function that i am preparing to make a zip:
public static String Zip(String folderPath)
{
String zipFilePath = null;
try
{
}
catch (Exception ex)
{
MessageBox.Show("" + ex.Message, "LN Exception", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
return zipFilePath;
}
So please , help to start of . . Thank you in advance . .
To add a reference, right click on your project and select Add Reference
Then browse and add the file
Then here is basic code that shows you how to add a file to the zip
using (ZipFile zip = new ZipFile())
{
zip.AddFiles(.....);
zip.Save(....);
}
Where the dots are in the code sample above, use intellisense and fill out the required parameters.
We are not here to do your entire assignment for you but this will help get you started.