private static int zipIt(string whereToZip, string whatToZip, int howManySecondWait)
{ // whereToZip - Archive name
// whatToZip - file names
// howManySecondWait - how many second wait before kill the process.
System.Diagnostics.Process p = new System.Diagnostics.Process();
p.StartInfo.FileName = "C:\\Program Files\\WinZip\\WINZIP32";
p.StartInfo.Arguments = "-ex -a -ybc \"" + whereToZip + "\" \"" + whatToZip + "\"";
p.Start();
bool bExited = p.WaitForExit(howManySecondWait*1000);
if ( !bExited )
{
p.Kill();
informAboutAnError( "wzzip was killed after executing during " + (howManySecondWait).ToString() + " sec");
}
int ret = p.ExitCode;
p.Close();
return ret;
}