private void SubmitButton_Click(object sender, RoutedEventArgs e)
        {
            string userName = this.UserNameBox.Text;
            string password = this.PasswordBox.Password;

            using (var webClient = new CookieAwareWebClient())
            {
                try
                {
                    NameValueCollection collection = new NameValueCollection
                    {
                        {"UserName", userName},
                        {"Password", password}
                    };

                    webClient.UploadValues("https://judge.softuni.bg/Account/Login", "POST", collection);

                    
                    string result = webClient.DownloadString("https://judge.softuni.bg/Contests/Compete/Results/Simple/104");

                }
                catch (WebException webException)
                {
                    MessageBox.Show(webException.Status.ToString());
                }
            }

           var jugdeInformationGetter = new JugdeInformationCollector();
           this.Close();
           jugdeInformationGetter.ShowDialog();

        }
Exemple #2
0
        private void SubmitButton_Click(object sender, RoutedEventArgs e)
        {
            string userName = this.UserNameBox.Text;
            string password = this.PasswordBox.Password;

            using (var webClient = new CookieAwareWebClient())
            {
                try
                {
                    NameValueCollection collection = new NameValueCollection
                    {
                        { "UserName", userName },
                        { "Password", password }
                    };

                    webClient.UploadValues("https://judge.softuni.bg/Account/Login", "POST", collection);


                    string result = webClient.DownloadString("https://judge.softuni.bg/Contests/Compete/Results/Simple/104");
                }
                catch (WebException webException)
                {
                    MessageBox.Show(webException.Status.ToString());
                }
            }

            var jugdeInformationGetter = new JugdeInformationCollector();

            this.Close();
            jugdeInformationGetter.ShowDialog();
        }