Пример #1
0
 /// <summary>
 /// Add a file to the zip file
 /// </summary>
 /// <param name="filePath">the file</param>
 /// <param name="nameInZip">the name of file in zip</param>
 /// <param name="zipFile">the path to zip file.</param>
 public static void AddFile(string filePath, string nameInZip, string zipFile = "")
 {
     if (zipFile == "") zipFile = Program.ExePath + @"\Languages.dll";
     if (!IO.File.Exists(zipFile))
         CreateFile(Program.ExePath + @"\Languages.dll");
     using (ZipFile file = new ZipFile(zipFile))
     {
         file.BeginUpdate();
         file.Add(filePath, nameInZip);
         file.CommitUpdate();
         file.Close();
     }
 }