Exemplo n.º 1
0
        public MainWindow()
        {
            InitializeComponent();
            U.Update();
            users.Text      = String.Join(" ", U.users);
            passswords.Text = String.Join(" ", U.passwords);
            string line = Txt.ReadLine();

            if (!(line == "None"))
            {
                int     id      = Convert.ToInt32(line);
                Window1 window1 = new Window1(U.users[id]);
                this.Hide();
                window1.ShowDialog();
                this.Show();
            }
        }
Exemplo n.º 2
0
 private void BtnLog_Click(object sender, RoutedEventArgs e)
 {
     if (Captchatb.Text == Captchatxt.Text || !flagFail)
     {
         bool flag = false;
         int  N    = -1;
         for (int i = 0; i < U.users.Length; i++)
         {
             string user = U.users[i];
             flag = user == Username.Text;
             if (flag)
             {
                 N = i;
                 break;
             }
         }
         if (flag && Password.Text == U.passwords[N])
         {
             flagFail           = false;
             Captcha.Visibility = Visibility.Hidden;
             Window1 window1 = new Window1(U.users[N]);
             if (flagLog)
             {
                 Txt.WriteLine(N.ToString());
             }
             else
             {
                 Txt.WriteLine("None");
             }
             this.Hide();
             window1.ShowDialog();
             this.Show();
         }
         else
         {
             flagFail           = true;
             Captchatxt.Text    = CaptchaClass.GetNew();
             Captcha.Visibility = Visibility.Visible;
         }
     }
     Captchatxt.Text = CaptchaClass.GetNew();
 }
Exemplo n.º 3
0
 private void logout_Click(object sender, RoutedEventArgs e)
 {
     Txt.WriteLine("None");
     this.Close();
 }