public static void Login() { do { try { GetCheckImage(); } catch (System.Exception ex) { checkImg = null; Trace.WriteLine("登录 图片验证码失败,重新登录" + ex.StackTrace); Thread.Sleep(1000); } } while (checkImg == null || !checkImg.IsLoginFinshed()); Trace.WriteLine("登录 图片验证码 成功"); }
public static void LoginAsyn() { checkImg = null; AsynThread = new System.Threading.Thread(new ThreadStart(Login)); AsynThread.Start(); }
public static CheckImage GetCheckImage() { string type = AccountFactory.getInstance().getImageCodeAcc().PlatformName; if (checkImg == null) { switch (type) { case "UU": checkImg = new UUCheckImage(); break; case "RK": checkImg = new RKCheckImage(); break; default: break; } } if (checkImg != null) { checkImg.Login(AccountFactory.getInstance().getImageCodeAcc().UserName, AccountFactory.getInstance().getImageCodeAcc().Passwd); } return checkImg; }