Esempio n. 1
0
        private void button2_Click(object sender, EventArgs e)
        {   //autorization
            if (textBox1.Text == "" || textBox2.Text == "")
            {
                EmptyRegistration reg = new EmptyRegistration();
                reg.Show();
            }
            else if (WorkFile.readFromFile(textBox1.Text))
            {
                Client client = new Client();
                var    x      = DateTime.DaysInMonth(2018, 5).GetHashCode();
                if (x < 0)
                {
                    x *= -1;
                }
                string a = (x + "word".GetHashCode() + getMD5(textBox2.Text).GetHashCode()) + "";

                client.sendmsg(textBox1.Text, a);
            }
            else
            {
                NotRegistrated notRegistrated = new NotRegistrated();
                notRegistrated.Show();
            }
            textBox1.Text = "";
            textBox2.Text = "";
        }
Esempio n. 2
0
        private void button1_Click(object sender, EventArgs e)
        {   //registration
            if (textBox1.Text == "" || textBox2.Text == "")
            {
                EmptyRegistration reg = new EmptyRegistration();
                reg.Show();
            }
            else if (WorkFile.readFromFile(textBox1.Text))
            {
                NotCurrentLogin notCurrentLogin = new NotCurrentLogin();
                notCurrentLogin.Show();
            }
            else
            {
                string login    = textBox1.Text;
                string password = getMD5(textBox2.Text);

                WorkFile.writeInFile(login, password);
                MessageBox.Show("You registrated!");
            }
            textBox1.Text = "";
            textBox2.Text = "";
        }