private void backupDatabase(string fileName) { System.Diagnostics.Process proc = new System.Diagnostics.Process(); string ipServer; ipServer = DS.getIPServer(); proc.StartInfo.FileName = "CMD.exe"; proc.StartInfo.Arguments = "/C " + "mysqldump -h " + ipServer + " -u SYS_POS_ADMIN -ppass123 sys_pos_bintangtimur > \"" + fileName + "\""; proc.Exited += new EventHandler(ProcessExited); proc.EnableRaisingEvents = true; gUtil.saveSystemDebugLog(0, "BACKUP DATABASE PROCESS STARTED [" + fileName + "]"); proc.Start(); }
private void syncInformation(string fileName) { string ipServer = ""; //string strCmdText = ""; System.Diagnostics.Process proc = new System.Diagnostics.Process(); Directory.SetCurrentDirectory(Application.StartupPath); ipServer = DS.getIPServer(); //strCmdText = "/C " + "mysql -h " + ipServer + " -u SYS_POS_ADMIN -ppass123 sys_pos < \"" + fileName + "\""; //System.Diagnostics.Process.Start("CMD.exe", strCmdText); proc.StartInfo.FileName = "CMD.exe"; proc.StartInfo.Arguments = "/C " + "mysql -h " + ipServer + " -u SYS_POS_ADMIN -ppass123 sys_pos < \"" + fileName + "\""; proc.Exited += new EventHandler(ProcessExited); proc.EnableRaisingEvents = true; gutil.saveSystemDebugLog(globalConstants.MENU_SINKRONISASI_INFORMASI, "SYNC INFORMATION PROCESS START"); proc.Start(); }