예제 #1
0
        private string DecodeCode(byte[] code)
        {
            if (code != null && code.Length > 0)
            {
                try
                {
                    var pCodeResult = new StringBuilder(new string(' ', 30));
                    var captchaId   = YdmWrapper.YDM_EasyDecodeByBytes(UserName, Password, AppId, AppKey, code, code.Length, CodeType, TimeOut, pCodeResult);
                    var ret         = pCodeResult.ToString();
                    if (captchaId > 0 && IsAvailableCode(ret))
                    {
                        return(ret);
                    }

                    ReportError(captchaId);
                    return(string.Empty);
                }
                catch (Exception)
                {
                    return(string.Empty);
                }
            }

            return(string.Empty);
        }
예제 #2
0
 private bool ReportError(int captchaId)
 {
     try
     {
         YdmWrapper.YDM_EasyReport(UserName, Password, AppId, AppKey, captchaId, false);
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }