Example #1
0
        public void ReadUserInfo()
        {
            string userName = Properties.Settings.Default.LocalUserName;

            if (!string.IsNullOrEmpty(userName))
            {
                this.IsSaveUser = true;
                this.UserName   = userName;
                this.Password   = PassWordHelpClass.PassWordDecrypt(Properties.Settings.Default.LocalPassword);
            }
        }
Example #2
0
        private void UserLoginSucceed()
        {
            if (this.IsSaveUser)
            {
                Properties.Settings.Default.LocalUserName = this.UserName.Trim();
                Properties.Settings.Default.LocalPassword = PassWordHelpClass.PassWordEncrypts(this.Password.Trim());
                Properties.Settings.Default.Save();
            }
            else
            {
                Properties.Settings.Default.LocalUserName = string.Empty;
                Properties.Settings.Default.LocalPassword = string.Empty;
                Properties.Settings.Default.Save();
            }

            MainWindow mwin = new MainWindow(SeatAttentionInfos);

            mwin.Show();
            GalaSoft.MvvmLight.Messaging.Messenger.Default.Send <string>("成功", "LoginViewModel");
        }