代码如下 | 复制代码 |
using System; /* AutoResetEvent are;//多线程同步信号 #region 读取hotmail邮箱通讯录 /// Login(username, password, IsPageAsync); return messenger.Nameserver.IsSignedIn == true ? GetAddressStatus.Success : GetAddressStatus.NetError; } /// try messenger.Credentials = new Credentials(username, password, (MsnProtocol)Enum.Parse(typeof(MsnProtocol), MsnProtocol.MSNP18.ToString())); messenger.Connect(); Thread.Sleep(3000); //线程休眠2秒 while (tmpCount < 6) //重连5次 this.Login(username, password, IsPageAsync); } } /// Dictionary foreach (KeyValuePair Person personeEntity = new Person(); tmpList.Add(personeEntity); } return tmpList; #region 异步读取 private Page _workingPage; public AddressHotMail(Page workingPage) private GetAddressStatus _addressStatus = GetAddressStatus.UidOrPwdError; /// Login(username, password); return _addressStatus; } /// SynchronizationContext context = AsyncOperationManager.SynchronizationContext; try messenger.Nameserver.SignedIn += new EventHandler messenger.NameserverProcessor.ConnectingException += new EventHandler messenger.Nameserver.ExceptionOccurred += new EventHandler messenger.Nameserver.AuthenticationError += new EventHandler if (messenger.Connected) messenger.Credentials = new Credentials(username, password, (MsnProtocol)Enum.Parse(typeof(MsnProtocol), MsnProtocol.MSNP18.ToString())); messenger.Connect(); are.WaitOne(); //UI线程等待 } private void Nameserver_SignedIn(object sender, EventArgs e) private void Nameserver_ExceptionOccurred(object sender, ExceptionEventArgs e) private void NameserverProcessor_ConnectingException(object sender, ExceptionEventArgs e) _addressStatus = GetAddressStatus.MailError; } private void Nameserver_AuthenticationError(object sender, ExceptionEventArgs e) _addressStatus = GetAddressStatus.UidOrPwdError; } } |
野比大雄的涅槃 最新版v0.8-625
野比大雄的涅槃是一款非常好玩的从端游移植而来的精品哆啦A梦同
汽车模拟器2内置菜单全车解锁版2024 最新版v1.54.2
汽车模拟器2内置涂装版是游戏的破解版本,在该版本中为玩家提供
快递到了亲内置菜单 安卓版v0.6.2
快递到了亲内置菜单是一款非常好玩的模拟经营类手游,内部有功能
我的世界为时已晚模组整合包 手机版v皮神木马
我的世界为时已晚模组整合包是一款剧情向的恐怖游戏像素风格沙盒
纸牌农庄内购版 v1.12.77
纸牌农庄无限道具版是一款将纸牌与模拟经营相结合的游戏,为玩家