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);
            }
        }
Esempio n. 2
0
 private void editorToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         WebClient client = new WebClient();
         string    access = client.DownloadString(Constants.getApiUrl() + "editor_pass_enable");
         if (access.Trim() == "0")
         {
             frmEditor frm = new frmEditor();
             frm.ShowDialog();
             reload_database();
         }
         else
         {
             frmEditorPassword frm = new frmEditorPassword();
             frm.Show();
         }
     }
     catch
     {
         MessageBox.Show("Не удалось подтвердить тип авторизации, повторите попытку.", "Order Automizer | Проверка авторизации", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }