void ITXIMLoginUIEventExt.OnServerVerifyCode(ITXData pData, out string pbsEnterCode, out int pbCancel) { pbsEnterCode = string.Empty; pbCancel = 1; ITXBuffer buf = pData.GetBuf(LoginUI.bufVerifyPic); uint size = buf.GetSize(); byte[] destination = new byte[size]; byte[] buffer2 = destination; if (buffer2 != null) { int length = buffer2.Length; } Marshal.Copy(buf.GetNativeBuf(), destination, 0, (int)size); MemoryStream memorystreamPng = new MemoryStream(destination); if (VerifyCodeWindow.ShowVerifyCode(memorystreamPng, this.winHandle, out pbsEnterCode)) { pbCancel = 0; } else { pbCancel = 1; } }
private void OnAccountsChanged() { if (this.accounts.SelectedIndex >= 0x0) { string selectedItem = (string)this.accounts.SelectedItem; IMContactStatus unknown = IMContactStatus.Unknown; ITXBuffer password = null; if (this.accountManager.GetAccountInfo(selectedItem, out password, out unknown)) { this.LoginStatus = unknown; if ((password != null) && (password.GetSize() > 0x0)) { this.passwordBox.Password = "******"; this.passwordHash = password; this.passwordType = IMPwdType.IMPWD_PWD_SAVED; this.rememberPasswordCheckBox.IsChecked = true; return; } this.passwordHash = null; this.passwordBox.Clear(); this.passwordType = IMPwdType.IMPWD_NONE; this.rememberPasswordCheckBox.IsChecked = false; return; } } this.passwordHash = null; this.passwordType = IMPwdType.IMPWD_NONE; this.passwordBox.Clear(); this.rememberPasswordCheckBox.IsChecked = false; }
private void Enter_Click(object sender, RoutedEventArgs e) { this.LoginResult = false; if (e.Source == this.Enter) { if (this._IsLogging) { TXLog.TXLog3("Login", " Enter_Click 重复"); } else { if (this.passwordHash == null) { string str = (this.accounts.SelectedIndex >= 0x0) ? (this.accounts.SelectedItem.ToString()) : this.accounts.Text; string password = this.passwordBox.Password.Trim(); if ((str.Length == 0x0) || (password.Length == 0x0)) { string messageBoxText = "帐号或者密码不能为空"; string caption = "提示"; MessageBox.Show(messageBoxText, caption); return; } this.passwordHash = CoreMessenger.CalculatePasswordHash(password); this.passwordType = IMPwdType.IMPWD_HASHONE; } if (CoreMessenger.Instance.TM.IsValidAccount(this.accounts.Text)) { if (App.Messenger.Login(this.accounts.Text, this.passwordHash, this.passwordType, this.LoginStatus)) { this._IsLogging = true; this.ShowInputFrame(false); e.Handled = true; } else { //Util_MessageBox.InvalidUinMsg(this, this.accounts.Text); } } else { string str5 = "请输入正确的QQ号码。"; string str6 = "提示"; MessageBox.Show(str5, str6); this.accounts.Text = ""; this.passwordBox.Clear(); this.accounts.Focus(); } } } else if (e.Source == this.btnCancel) { this._IsLogging = false; this.ShowInputFrame(true); App.Messenger.CancelLogin(); } }
internal static bool ShowReLoginWindow(string reason, Window win, out ITXBuffer ppbufPwd) { ReLoginWindow window = new ReLoginWindow(reason) { Owner = win }; window.ShowDialog(); ppbufPwd = window.GetPassWord(); return (window.DialogResult == true); }
void ITXIMLoginUIEventExt.OnReinputPassword(string bsReason, out ITXBuffer ppbufPwd, out int pbCancel) { if (ReLoginWindow.ShowReLoginWindow(bsReason, this.winHandle, out ppbufPwd)) { pbCancel = 0; } else { pbCancel = 1; } }
internal static bool ShowReLoginWindow(string reason, Window win, out ITXBuffer ppbufPwd) { ReLoginWindow window = new ReLoginWindow(reason) { Owner = win }; window.ShowDialog(); ppbufPwd = window.GetPassWord(); return(window.DialogResult == true); }
void ITXIMLoginUIEventExt.OnReinputPassword(string bsReason, out ITXBuffer ppbufPwd, out int pbCancel) { if (ReLoginWindow.ShowReLoginWindow(bsReason, this.winHandle, out ppbufPwd)) { pbCancel = 0; } else { pbCancel = 1; } }
void ITXIMLoginUIEventExt.OnSavePassword(ITXBuffer pNewBuffer) { if (pNewBuffer != null) { ITXIMConfig service = CoreMessenger.Instance.GetService<ITXIMConfig>(); ITXData xccebc = CoreMessenger.Instance.ObjectFactory.CreateTXData(); if (((pNewBuffer.GetSize() > 0) && (this._NeedtoSavePassword != null)) && this._NeedtoSavePassword()) { xccebc.SetBuf("bufSavedPassword", pNewBuffer); } service.SavePassword(xccebc); } }
void ITXIMLoginUIEventExt.OnSavePassword(ITXBuffer pNewBuffer) { if (pNewBuffer != null) { ITXIMConfig service = CoreMessenger.Instance.GetService <ITXIMConfig>(); ITXData xccebc = CoreMessenger.Instance.ObjectFactory.CreateTXData(); if (((pNewBuffer.GetSize() > 0) && (this._NeedtoSavePassword != null)) && this._NeedtoSavePassword()) { xccebc.SetBuf("bufSavedPassword", pNewBuffer); } service.SavePassword(xccebc); } }
private void accounts_TextChanged(object sender, TextChangedEventArgs e) { if ((this.accounts.SelectedItem as string) != this.accounts.Text) { this.passwordHash = null; this.passwordType = IMPwdType.IMPWD_NONE; this.passwordBox.Clear(); this.rememberPasswordCheckBox.IsChecked = false; this.LoginStatus = IMContactStatus.Available; } else { this.OnAccountsChanged(); } }
private void accounts_TextChanged(object sender, TextChangedEventArgs e) { if ((this.accounts.SelectedItem as string) != this.accounts.Text) { this.passwordHash = null; this.passwordType = IMPwdType.IMPWD_NONE; this.passwordBox.Clear(); this.rememberPasswordCheckBox.IsChecked = false; this.LoginStatus = IMContactStatus.Available; } else { this.OnAccountsChanged(); } }
private void OnPasswordChanged(object sender, RoutedEventArgs e) { this.passwordHash = null; this.passwordType = IMPwdType.IMPWD_NONE; }
void ITXIMLoginUIEventExt.OnEMBKPic(ITXBuffer pPicBuf) { DebugLog.Assert(false, "收到密保图片"); TXLog.TXLog2("Login", "收到密保图片"); }
private void Enter_Click(object sender, RoutedEventArgs e) { this.LoginResult = false; if (e.Source == this.Enter) { if (this._IsLogging) { TXLog.TXLog3("Login", " Enter_Click 重复"); } else { if (this.passwordHash == null) { string str = (this.accounts.SelectedIndex >= 0x0) ? (this.accounts.SelectedItem.ToString()) : this.accounts.Text; string password = this.passwordBox.Password.Trim(); if ((str.Length == 0x0) || (password.Length == 0x0)) { string messageBoxText = "帐号或者密码不能为空"; string caption = "提示"; MessageBox.Show(messageBoxText, caption); return; } this.passwordHash = CoreMessenger.CalculatePasswordHash(password); this.passwordType = IMPwdType.IMPWD_HASHONE; } if (CoreMessenger.Instance.TM.IsValidAccount(this.accounts.Text)) { if (App.Messenger.Login(this.accounts.Text, this.passwordHash, this.passwordType, this.LoginStatus)) { this._IsLogging = true; this.ShowInputFrame(false); e.Handled = true; } else { //Util_MessageBox.InvalidUinMsg(this, this.accounts.Text); } } else { string str5 = "请输入正确的QQ号码。"; string str6 = "提示"; MessageBox.Show(str5, str6); this.accounts.Text = ""; this.passwordBox.Clear(); this.accounts.Focus(); } } } else if (e.Source == this.btnCancel) { this._IsLogging = false; this.ShowInputFrame(true); App.Messenger.CancelLogin(); } }
private void OnPasswordChanged(object sender, RoutedEventArgs e) { this.passwordHash = null; this.passwordType = IMPwdType.IMPWD_NONE; }
private void OnAccountsChanged() { if (this.accounts.SelectedIndex >= 0x0) { string selectedItem = (string)this.accounts.SelectedItem; IMContactStatus unknown = IMContactStatus.Unknown; ITXBuffer password = null; if (this.accountManager.GetAccountInfo(selectedItem, out password, out unknown)) { this.LoginStatus = unknown; if ((password != null) && (password.GetSize() > 0x0)) { this.passwordBox.Password = "******"; this.passwordHash = password; this.passwordType = IMPwdType.IMPWD_PWD_SAVED; this.rememberPasswordCheckBox.IsChecked = true; return; } this.passwordHash = null; this.passwordBox.Clear(); this.passwordType = IMPwdType.IMPWD_NONE; this.rememberPasswordCheckBox.IsChecked = false; return; } } this.passwordHash = null; this.passwordType = IMPwdType.IMPWD_NONE; this.passwordBox.Clear(); this.rememberPasswordCheckBox.IsChecked = false; }
void ITXIMLoginUIEventExt.OnEMBKPic(ITXBuffer pPicBuf) { DebugLog.Assert(false, "收到密保图片"); TXLog.TXLog2("Login", "收到密保图片"); }