private void OK_Click(object sender, RoutedEventArgs e) { string user_id = txtUser.Text.Trim(); string user_pwd = txtPwd.Password; string ip_addr = txtIp_addr.Text.Trim(); progressBar.IsIndeterminate = true; btn_OK.IsEnabled = false; UserResinfoInput input = new UserResinfoInput(user_id, user_pwd, ip_addr); backgroundWorker.RunWorkerAsync(input); }
private void backgroundWorker_DoWork(object sender, DoWorkEventArgs e) { // Get the input values. UserResinfoInput input = (UserResinfoInput)e.Argument; // Start the search for primes and wait. Res(input.User_id, input.User_pwd, input.Ip_addr, backgroundWorker); if (backgroundWorker.CancellationPending) { e.Cancel = true; return; } }