Exemplo n.º 1
0
        public static void check_length(string stroka, string acc)
        {
            if (acc == "")
            {
                if (Config.rus_lang)
                {
                    MessageBox.Show("Введите название аккаунта");
                }
                else
                {
                    MessageBox.Show("Write name of your account");
                }
                Config.you_can = false;
            }

            else if (stroka == "")
            {
                if (Config.rus_lang)
                {
                    MessageBox.Show("Введите пароль");
                }
                else
                {
                    MessageBox.Show("Write your password");
                }
                Config.you_can = false;
            }
            if (stroka.Length >= 25)
            {
                if (Config.rus_lang)
                {
                    MessageBox.Show("Пароль должен содержать менее 25 символов");
                }
                else
                {
                    MessageBox.Show("Password should be less then 25 symbols");
                }
                Config.you_can = false;
            }
            if (stroka.Contains(Convert.ToString('+')) || stroka.Contains(Convert.ToString(':')) || stroka.Contains(Convert.ToString('"')) || stroka.Contains(Convert.ToString('|')))
            {
                if (Config.rus_lang)
                {
                    MessageBox.Show("Пароль не должен содержать символы '+', кавычки, '|' или ':'");
                }
                else
                {
                    MessageBox.Show("Password shouldn't contains '+', quotation marks, '|' or ':'");
                }
                Config.you_can = false;
            }
            Shifr.have_it(stroka, Config.alf);
            if (Config.error_no_symbol)
            {
                Config.error_no_symbol = false;
                Config.you_can         = false;

                if (Config.rus_lang)
                {
                    DialogResult res = MessageBox.Show("Символов " + Config.ot_symb + " нет в алфавите, добавить их?", "Ошибка", MessageBoxButtons.YesNo);
                    if (res == DialogResult.Yes)
                    {
                        New_element form = new New_element(Config.ot_symb);
                        form.Show();
                    }
                }
                else
                {
                    DialogResult res = MessageBox.Show("Alphabet doesn't have " + Config.ot_symb + ". Do you want add this symbols?", "Error", MessageBoxButtons.YesNo);
                    if (res == DialogResult.Yes)
                    {
                        New_element form = new New_element(Config.ot_symb);
                        form.Show();
                    }
                }
            }
        }
Exemplo n.º 2
0
        private void new_element_Click(object sender, EventArgs e)
        {
            New_element main = new New_element(null);

            main.Show();
        }