Guest User

Untitled

a guest
Mar 13th, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. public static bool Zip(string DestFile, string Source)
  2. {
  3. try
  4. {
  5. Process Zip = new Process();
  6. Zip.StartInfo.CreateNoWindow = true;
  7. Zip.StartInfo.FileName = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + @"\7z.exe";
  8. Zip.StartInfo.Arguments = "a -tzip -mx9 \"" + DestFile + "\" \"" + Source + "\"";
  9. Zip.StartInfo.CreateNoWindow = true;
  10. Zip.Start();
  11. Zip.WaitForExit();
  12. }
  13. catch
  14. {
  15. return false;
  16. }
  17.  
  18. return true;
  19. }
Add Comment
Please, Sign In to add comment