找传奇、传世资源到传世资源站!

C# 实现微信扫描二维码 自动登陆 winform应用程序 示例源码

8.5玩家评分(1人评分)
下载后可评
介绍 评论 失效链接反馈

机器人登录
from clipboard
from clipboard

from clipboardusing System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows.Forms;using UtilWx;namespace wxSerfendRbt{ public partial class frmLogin : Form { public frmLogin() { InitializeComponent(); } private void frmLogin_Load(object sender, EventArgs e) { } private void frmLogin_Shown(object sender, EventArgs e) { Program.wx = new WxLib(); Program.wx.QrCodeIsOutofdate =ReloadQrCode; Program.wx.QrCodeScanCompleted = ReloadUserAvatar;Program.wx.UserLogin = ShowUserList;this.ReloadQrCode(); }#region WxLibEventprivate delegate void UserLoginIn(object sender, WxLib.UserLoginEventArgs e);private void ShowUserList(object sender, WxLib.UserLoginEventArgs e){if (this.ipLoginInfo.InvokeRequired){UserLoginIn s = new UserLoginIn(ShowUserList);this.Invoke(s, new object[] { sender, e });}else{this.Hide();Form f = new FrmMain();f.ShowDialog();this.Dispose();}}private delegate void AvatarLoad(object sender,WxLib.QrCodeScanCompletedEventArgs e); private void ReloadUserAvatar(object sender, WxLib.QrCodeScanCompletedEventArgs e) { if(this.ipLoginInfo .InvokeRequired) { AvatarLoad s = new AvatarLoad(ReloadUserAvatar); this.Invoke(s, new object[] { sender, e }); } else {QrCodeShow.Image = e.userAvatar; ipLoginInfo.Text = "在手机或设备上点击确认..."; } } private bool firstRun = true; private delegate void QrCodeLoad(); private void ReloadQrCode() { if(this.ipLoginInfo.InvokeRequired) {System.Threading.Thread.Sleep(2000);QrCodeLoad s = new QrCodeLoad(ReloadQrCode);try{this.Invoke(s);}catch { } } else {ipLoginInfo.Text = "加载二维码..."; string rel = Program.wx.GetLoginQrCode(out Image tmpImg,firstRun);ipLoginInfo.Text = rel;if (tmpImg != null){firstRun = false;QrCodeShow.Image = tmpImg;}else{System.Threading.Thread QrCodeLoader = new System.Threading.Thread(new System.Threading.ThreadStart(ReloadQrCode)){IsBackground = true};QrCodeLoader.Start();} } }#endregion}}

评论

发表评论必须先登陆, 您可以 登陆 或者 注册新账号 !


在线咨询: 问题反馈
客服QQ:174666394

有问题请留言,看到后及时答复