Esempio n. 1
0
        private void DlgLogin_Load(object sender, EventArgs e)
        {
            try
            {
                string resname = "Johnny.Kaixin.WinUI.Resources.EncryptFriends.config";
                using (StreamReader streamReader = new StreamReader(Assembly.GetExecutingAssembly().GetManifestResourceStream(resname)))
                {
                    string configContent = streamReader.ReadToEnd();
                    _friends = ConfigCtrl.GetEncryptFriendFromFile(configContent);
                }

                if (_friends == null || _friends.Count == 0)
                {
                    MessageBox.Show("无法取得好友列表!", Constants.MESSAGEBOX_CAPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    this.DialogResult = DialogResult.Cancel;
                    this.Close();
                }

                chkRemember.Checked = Properties.Settings.Default.NeedRemember;
                if (chkRemember.Checked)
                {
                    txtUserName.Text = Properties.Settings.Default.LoginUserName;
                    txtUserId.Text   = Properties.Settings.Default.LoginUserID;
                }
            }
            catch (Exception ex)
            {
                Program.ShowMessageBox("DlgLogin", ex);
            }
        }