public WinMain(WebQQCommon communication) : this() { this.webqq = communication; RegisteEvent(communication); LoadRules(); }
private void CheckVerifyCode() { string userName = txtUin.Text.Trim(); string passWord = txtPassWord.Text.Trim(); if (string.IsNullOrWhiteSpace(userName) || string.IsNullOrWhiteSpace(passWord)) { return; } LoginInfo loginInfo = new LoginInfo { Username = userName, PassWord = passWord }; communication = new WebQQCommon(loginInfo); if (communication.IsNeedVerifyCode()) { Stream stream = communication.GetVerifyCodePicStream(); if (stream != null) { Image image = Image.FromStream(stream); this.pbVerifyCode.Image = image; //image.Save(@"C:\123.bmp"); SetVerifyCodeVisible(true); } else { } } else { SetVerifyCodeVisible(false); } }
private void RegisteEvent(WebQQCommon communication) { communication.OnAddFriendEvent += communication_OnAddFriendEvent; //communication.OnFriendMessageEvent+=communication_OnFriendMessageEvent; communication.OnOffLine += communication_OnOffLine; communication.OnGroupMessageArrivedEvent += communication_OnQunMessageEvent; communication.OnJoinRequested += communication_OnSystemMessageArrive; }