private void button1_Click(object sender, EventArgs e) { int selectedServer = 0; selectedServer = DomainList.SelectedIndex; cPanelBackup.Backup backup = new Backup(); backup.InitializeFtpData("ftp.domain.com", "ftp_login", "ftp_pass", 21); string postData = "dest=ftp&email_radio=1&[email protected]&server=" + backup.FtpHost + "&user="******"&pass="******"&port=" + backup.FtpPort; backup.sendPostRequest(backup.Domain, 2082, postData, selectedServer); }
/// <summary> /// Work as long as you need :) /// </summary> private void DoBackupWork(object sender, DoWorkEventArgs e) { int selectedServer = 0; selectedServer = SelectedServer; Backup backup = new Backup(); backup.InitializeFtpData("ftp.domain.com", "ftp_login", "ftp_pass", 21); string postData = "dest=ftp&email_radio=1&[email protected]&server=" + backup.FtpHost + "&user="******"&pass="******"&port=" + backup.FtpPort; backup.sendPostRequest(backup.Domain, 2082, postData, selectedServer); Log4cs.Log("Doing backup: {0}", postData); Debug("Going to send backup request"); Thread.Sleep(10000); }