コード例 #1
0
ファイル: WpfLogin.xaml.cs プロジェクト: Leowhh/Wpftest
        private void Login_Click(object sender, RoutedEventArgs e)
        {
            string user_id  = txtUser.Text.Trim();
            string user_pwd = txtPwd.Password;
            int    type;

            progressBar.IsIndeterminate = true;
            btn_Login.IsEnabled         = false;
            type = Convert.ToInt32(IDtype.SelectedIndex);

            UserinfoInput input = new UserinfoInput(user_id, user_pwd, type);

            backgroundWorker.RunWorkerAsync(input);
        }
コード例 #2
0
ファイル: WpfLogin.xaml.cs プロジェクト: Leowhh/Wpftest
        private void backgroundWorker_DoWork(object sender, DoWorkEventArgs e)
        {
            // Get the input values.
            UserinfoInput input = (UserinfoInput)e.Argument;

            // Start the search for primes and wait.
            bool result = Login(input.User_id, input.User_pwd, input.IDtype, backgroundWorker);

            if (backgroundWorker.CancellationPending)
            {
                e.Cancel = true;
                return;
            }

            // Return the result.
            e.Result = result;
        }