Exemplo n.º 1
0
        private async void RefreshCaptcha()
        {
            var captcha = await URP.GetCaptcha();

            imageCaptcha.Source        = captcha;
            captcha.DownloadCompleted += (s, e) => txtCaptcha.Text = Captcha.Read(captcha);
        }
Exemplo n.º 2
0
 private async void TestLogin()
 {
     if (await URP.Test())
     {
         loginMsg.Content = "登录状态: 已登录";
     }
     else
     {
         loginGrid.Visibility = Visibility.Visible;
         RefreshCaptcha();
     }
 }
Exemplo n.º 3
0
        private async void TryLogin()
        {
            loginMsg.Content = "尝试登录...";
            var success = await URP.Login(txtUser.Text, txtPass.Password, txtCaptcha.Text);

            if (success)
            {
                loginMsg.Content     = "登录状态: 已登录";
                loginGrid.Visibility = Visibility.Collapsed;
                SaveTemp();
            }
            else
            {
                loginMsg.Content = "登录状态: 登录失败";
                RefreshCaptcha();
                txtCaptcha.Clear();
            }
        }
Exemplo n.º 4
0
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     LoadTemp();
     URP.Build();
     TestLogin();
 }
Exemplo n.º 5
0
        private async void Search_Click(object sender, RoutedEventArgs e)
        {
            var list = await URP.GetSpareClassroom(txtJC.Text, "5001", "05", "2018-2019-1-1", txtXQ.Text, txtZC.Text);

            msgBox.Text = string.Join(" ", list);
        }