首页 > 资料收集 > C#调用亦思DLL识别验证码备份

C#调用亦思DLL识别验证码备份

亦思验证码识别

 

下面是关于C#调用亦思DLL来识别验证码的方法的,需要亦思破解版的可以加群:37140394,找群主要。这里是自己从易语言的调用方法中修改过来的,有2种识别方式,第一种保存到本地识别,第二种直接在内存中识别。


 

保存到本地识别的方法
  1. public static void Recognition(ref string jieguo, string url, string locatepic, ref string resultpic)
  2. {
  3.     try
  4.     {
  5.         int i = 0;
  6.         int n2 = 0;
  7.         IntPtr n1 = new IntPtr();
  8.  
  9.         IntPtr no1 = Recognition(1, null, 0, url, locatepic, ref n1, ref n2, ref i);
  10.         jieguo = Marshal.PtrToStringAnsi(no1);
  11.      //   Writepic("");     //这行代码的目的是把图片解码成bmp图片,可选。             
  12.     //    resultpic = @"c:\code.bmp";  //默认存放到c:\code.bmp
  13.     }
  14.     catch (System.Exception ex)
  15.     {
  16.     }
  17. }

验证码图片保存到本地识别
  1. imageStream = System.Drawing.Image.FromStream(TianCiClass.GetHttpImageByGet(codeurl, cookie));
  2.     result = "";
  3.     imglocation = "";
  4.     imageStream.Save("code.bmp");
  5.  
  6.    // Thread.Sleep(AddFriendDelyTime * 1000);
  7.  
  8.     TianCiClass.Recognition(ref result, "", "code.bmp", ref imglocation);
  9.     code = result;

下面记录下朋友告诉我的直接内存识别

Code
  1. public static void Recognition(ref string jieguo, byte[] pic, int bytepic, string locatepic)
  2.    {
  3.        try
  4.        {
  5.            int cLength = 0;
  6.            int lpLength = 0;
  7.            IntPtr lppicout = new IntPtr();
  8.            IntPtr ptr = Recognition(1, pic, bytepic, null, locatepic, ref lppicout, ref lpLength, ref cLength);
  9.            jieguo = Marshal.PtrToStringAnsi(ptr);
  10.        }
  11.        catch (Exception)
  12.        {
  13.        }
  14.    }

Code
  1. Image imageStream = System.Drawing.Image.FromStream(TianCiClass.GetHttpImageByGet(codeurl, cookie));
  2.  
  3.       MemoryStream ms = new MemoryStream();
  4.       byte[] imagedata = null;
  5.       imageStream.Save(ms, System.Drawing.Imaging.ImageFormat.Bmp);
  6.       imagedata = ms.GetBuffer();
  7.       string result = "";
  8.       string imglocation = "";
  9.       //   imageStream.Save("pic_.bmp");  
  10.       //   TianCiClass.Recognition(ref result, "", "pic_.bmp", ref imglocation);
  11.       TianCiClass.Recognition(ref result, imagedata, imagedata.Length, imglocation);
  12.       //  pictureBox1.ImageLocation = imglocation;
  13.       //   textBox1.Text = result;
  14.       string code = result;

Popularity: 20% [?]

你可能对下面的内容也感兴趣

分类: 资料收集 标签: , 阅读:114
  1. 本文目前尚无任何评论.
  1. 本文目前尚无任何 trackbacks 和 pingbacks.
1331443447264546273911415023892017429424948361425181521243813371040191235223743253228361630