private void buttonGo_Click(object sender, EventArgs e) { string targetPath = textBox1.Text; // create directory if no exist try { System.IO.Directory.CreateDirectory(targetPath); Report("Target path verified"); } catch { Report("Error with target path"); } // login rest = new REST("http", "www.digitous.com"); int status = rest.Login("dcave", "superman1!"); if (200 == status) { Report("Login successful"); } else { Report("Login failed!"); return; } string destPathForRoot = targetPath; DownloadFolder(0, destPathForRoot); // start worker BackgroundWorker bgw = new BackgroundWorker(); bgw.WorkerReportsProgress = true; bgw.DoWork += new DoWorkEventHandler(bgw_DoWork); bgw.ProgressChanged += new ProgressChangedEventHandler(bgw_ProgressChanged); bgw.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bgw_RunWorkerCompleted); bgw.RunWorkerAsync(null); }
private void buttonGo_Click(object sender, EventArgs e) { string targetPath = textBox1.Text; // create directory if no exist try { System.IO.Directory.CreateDirectory(targetPath); Report("Target path verified"); } catch { Report("Error with target path"); } // login rest = new REST("http", "www.digitous.com"); int status = rest.Login("dcave", "superman1!"); if (200 == status) Report("Login successful"); else { Report("Login failed!"); return; } string destPathForRoot = targetPath; DownloadFolder(0, destPathForRoot); // start worker BackgroundWorker bgw = new BackgroundWorker(); bgw.WorkerReportsProgress = true; bgw.DoWork += new DoWorkEventHandler(bgw_DoWork); bgw.ProgressChanged += new ProgressChangedEventHandler(bgw_ProgressChanged); bgw.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bgw_RunWorkerCompleted); bgw.RunWorkerAsync(null); }