/// <summary> /// 获取验证码 /// </summary> private BitmapImage GetCaptcha() { var result = AppHelper.GetCaptchResult(); if (!string.IsNullOrWhiteSpace(result.Content)) { CurrentCookies = result.CookieCollection; return(AppHelper.GetCaptchaBitmapImage(result)); } return(null); }
/// <summary> /// 操作步聚:访问站点,获取Cookies及验证码Base64 /// </summary> /// <param name="model"></param> /// <returns></returns> private string StepByOpenAndGetCaptchaBase64(QuestSourceModel model) { ShowStatusText(string.Format("{0}[登录],正在读取验证码", model.Name)); string codeBase64 = string.Empty; var result = AppHelper.GetCaptchResult(); if (!VerifyHelper.IsEmpty(result.Content)) { model.Cookies = result.CookieCollection; codeBase64 = result.Content; } ShowStatusText(string.Format("{0}[登录],验证码读取 {1}", model.Name, !VerifyHelper.IsEmpty(codeBase64) ? "成功" : "失败")); return(codeBase64); }