private void LogInBtn_Click(object sender, RoutedEventArgs e) { bool do_upload = (MessageBox.Show("Upload Now?", "Upload Log", MessageBoxButton.YesNo) == MessageBoxResult.Yes) ? true : false; if (do_upload) { var pwd = System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); QAToolsFacade.UploadLogToSftp(SftpUserTB.Text.Trim(), GammaRSASimplify.RSAEncryptString(SftpPWDTB.Password, System.IO.Path.Combine(pwd, "pubkf.xml")), SftpLocTB.Text.Trim(), UploadPath.Text.Trim()); } }
private void UploadLog() { InProgressWait(true); var pwd = System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); var pubkf = System.IO.Path.Combine(pwd, "pubkf.xml"); #if !UICHECK var task = QAToolsFacade.UploadLogToSftp(Username, GeneralUtility.GammaRSASimplify.RSAEncryptString(Password, pubkf), Bugnum, UploadPath, UpdateResult); #else var task = Task.Run(() => { UpdateResult("t1!"); UpdateResult("t2!"); Thread.Sleep(TimeSpan.FromSeconds(2)); }); #endif task.GetAwaiter().OnCompleted(() => { InProgressWait(false); UpdateResult("Finished!"); }); }