Esempio n. 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                string hash1, hash2;
                hash1 = CalculateMD5Hash(textBox1.Text);

                this.Text = hash1;

                WebClient client = new WebClient();
                hash2 = client.DownloadString(Constants.getApiUrl() + "editor_pass_hash");
                hash2 = hash2.Trim();



                if (hash1.Trim() == hash2.Trim())
                {
                    frmEditor frm = new frmEditor();
                    frm.Show();
                    this.Close();
                }
                else
                {
                    MessageBox.Show("Пароль введен неправильно!", "Order Automizer | Ошибка ввода", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch
            {
                MessageBox.Show("Сервер авторизации недоступен, обратитесь к системному администратору.", "Order Automizer | Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }