Exemple #1
0
        public void Show_UserInfo()
        {
            UserRegistr.User user = new UserRegistr.User();
            using (BinaryReader reader = new BinaryReader(File.Open(@"D:\Rider\Git\С# Prjcts\authWPF\authWPF\bin\Debug\user.dat", FileMode.Open)))
            {
                user.Fam      = reader.ReadString();
                user.Username = reader.ReadString();
                user.Otchesvo = reader.ReadString();
                user.Login    = reader.ReadString();
                user.Password = reader.ReadString();
            }

            Fam.Content       = user.Fam;
            Username.Content  = user.Username;
            Otch.Content      = user.Otchesvo;
            showlogin.Content = user.Login;
        }
        private void Login_OnClick(object sender, RoutedEventArgs e)
        {
            UserRegistr.User user = new UserRegistr.User();
            using (BinaryReader reader = new BinaryReader(File.Open(@"D:\Rider\Git\С# Prjcts\authWPF\authWPF\bin\Debug\user.dat", FileMode.Open)))
            {
                user.Fam      = reader.ReadString();
                user.Username = reader.ReadString();
                user.Otchesvo = reader.ReadString();
                user.Login    = reader.ReadString();
                user.Password = reader.ReadString();
            }

            if (enteredLogin.Text == user.Login)
            {
                if (enteredPassword.Text == user.Password)
                {
                    UserInfo info = new UserInfo();
                    info.Show();
                    this.Close();
                }
            }
        }