Code:
//easy way to make zip files without any dlls
//version indipendent
public void MakeZip(string SourceFileName,string ZipFileName)// Zip functionality added by madhu
    {
        System.Diagnostics.Process scriptProc = new System.Diagnostics.Process();
        if (File.Exists(SourceFileName))
            {
            string command = "zip " + ZipFileName + " " + SourceFileName; // Building dos commands           
            System.Diagnostics.ProcessStartInfo procStartInfo =  new System.Diagnostics.ProcessStartInfo("cmd", "/c " + command);
            scriptProc.StartInfo = procStartInfo;
            scriptProc.Start();
            int id = scriptProc.Id; //get process id
            start:
            System.Diagnostics.Process[] processlist = System.Diagnostics.Process.GetProcessesByName("cmd");
            foreach (System.Diagnostics.Process theprocess in processlist) 
            {
                if (theprocess.Id == id) //check proc id is found or not
                {
                    goto start;
                }                
            }
            scriptProc.Close();
        }
    }

Last edited by coderzone; 24May2012 at 16:30.. Reason: Code blocks