Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static bool Zip(string DestFile, string Source)
- {
- try
- {
- Process Zip = new Process();
- Zip.StartInfo.CreateNoWindow = true;
- Zip.StartInfo.FileName = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + @"\7z.exe";
- Zip.StartInfo.Arguments = "a -tzip -mx9 \"" + DestFile + "\" \"" + Source + "\"";
- Zip.StartInfo.CreateNoWindow = true;
- Zip.Start();
- Zip.WaitForExit();
- }
- catch
- {
- return false;
- }
- return true;
- }
Add Comment
Please, Sign In to add comment