Beispiel #1
0
 /// <summary>
 /// 验证码识别
 /// </summary>
 /// <param name="byt">图像数组</param>
 /// <returns></returns>
 public string GetPicStringCode(Bitmap bit)
 {
     try
     {
         string code   = string.Empty;
         byte[] buffer = GetPicBytes(bit);
         int    count  = 0;
         do
         {
             if (buffer != null)
             {
                 codeBuilder.Length = 0;
                 if (SundayAPI.GetCodeFromBuffer(1, buffer, buffer.Length, codeBuilder))
                 {
                     code = codeBuilder.ToString();
                 }
             }
             count++;
         } while (count < 1 && code.Length != 4);
         return(code);
     }
     catch
     {
         return("");
     }
 }
Beispiel #2
0
 public PicRecognation()
 {
     byte[] buffer = Resources.data;
     if (!SundayAPI.LoadLibFromBuffer(buffer, buffer.Length, "123"))
     {
         _susess = false;
     }
     else
     {
         _susess = true;
     }
 }