{"id":19992114,"url":"https://github.com/microfisher/Captcha-Recognizer","last_synced_at":"2025-05-04T11:30:41.594Z","repository":{"id":40936085,"uuid":"50559140","full_name":"microfisher/Captcha-Recognizer","owner":"microfisher","description":"基于C#.NET异步图形验证码识别组件（集成了若快、优优云、打码兔、云打码等平台，准确率95%，速度2-6秒）采用策略设计模式","archived":false,"fork":false,"pushed_at":"2022-06-24T00:43:29.000Z","size":1187,"stargazers_count":238,"open_issues_count":2,"forks_count":98,"subscribers_count":34,"default_branch":"master","last_synced_at":"2024-11-13T04:54:47.304Z","etag":null,"topics":["captcha","captcha-recognizer","recognizer"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/microfisher.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-01-28T05:47:19.000Z","updated_at":"2024-10-29T11:39:23.000Z","dependencies_parsed_at":"2022-09-20T17:53:21.336Z","dependency_job_id":null,"html_url":"https://github.com/microfisher/Captcha-Recognizer","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microfisher%2FCaptcha-Recognizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microfisher%2FCaptcha-Recognizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microfisher%2FCaptcha-Recognizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microfisher%2FCaptcha-Recognizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/microfisher","download_url":"https://codeload.github.com/microfisher/Captcha-Recognizer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252329120,"owners_count":21730553,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["captcha","captcha-recognizer","recognizer"],"created_at":"2024-11-13T04:52:02.641Z","updated_at":"2025-05-04T11:30:40.131Z","avatar_url":"https://github.com/microfisher.png","language":"C#","funding_links":[],"categories":["C\\#"],"sub_categories":[],"readme":"# 验证码识别\n\n异步图形验证码识别程序（集成了若快、优优云、打码兔、云打码等人工打码平台），很多人问为什么要在Decoder中使用反射功能获取策略类，这是因为使用了策略设计模式，便于限制其他开发调用者了解内部策略细节。当然也可以做成直接从外部传递实例化的策略类来实现，各种方式都有利有弊，请自己权衡修改。\n\n### 主要特性\n\n- 采用策略设计模式分离各个打码平台；\n- 支持异步方式多并发识别；\n- 识别完成后自动事件通知；\n- 反射方式获取识别策略;\n- 人工识别准确率高达95%，平均速度在2-6秒左右；\n\n\n### 运行截图\t\n\n![验证码示例](https://github.com/coldicelion/Captcha-Recognizer/blob/master/Wesley.Component.Captcha.Example/Resources/example.png?raw=true)\n\n![控制台运行示例](https://github.com/coldicelion/Captcha-Recognizer/raw/master/Wesley.Component.Captcha.Example/Resources/running.jpg?raw=true)\n\n\n### 当前集成了哪些第三方平台？\n\n- 若快打码 [http://www.ruokuai.com ](http://www.ruokuai.com \"若快打码\")\n- 优优云 [http://www.uuwise.com ](http://www.uuwise.com \"优优云\")\n- 云打码 [http://yundama.com ](http://yundama.com \"云打码\")\n- 打码兔 [http://www.dama2.com ](http://www.dama2.com \"打码兔\")\n\n\n### 示例代码\n\tstatic class Program\n    {\n        static void Main(string[] args)\n        {\n            //第一个参数是第三方平台\n            //第二个参数是平台账号信息，若此处不设置Account，则需要在策略代码中设置默认值\n            var decoder = new Decoder(Platform.RuoKuai, new Account\n            {\n                SoftId = 0, // 软件ID（此ID需要注册开发者账号才可获得）\n                TypeId = 0, // 验证码类型（四位字符或其他类型的验证码，根据各平台设置不同值）\n                SoftKey = null, //软件Key （此Key也需要注册开发者账号才可获得）\n                UserName = null, //账号（此账号为打码平台的普通用户账号，开发者账号不能进行图片识别）\n                Password = null //密码\n            });\n            decoder.OnStart += (s, e) =\u003e\n            {\n                Console.WriteLine(\"验证码（\"+e.FilePath+\"）识别启动……\");\n            };\n            decoder.OnCompleted += (s, e) =\u003e\n            {\n                Console.WriteLine(\"验证码（\" + e.FilePath + \"）识别完成：\" + e.Code + \"，耗时：\" + (e.Milliseconds/1000) + \"秒，线程ID：\"+e.ThreadId);\n            };\n            decoder.OnError += (s, e) =\u003e\n            {\n                Console.WriteLine(\"验证码识别出错：\" + e.Exception.Message);\n            };\n            for (var i = 1; i \u003c= 3; i++)\n            {\n                decoder.Decode(\"c:\\\\checkcode\"+i+\".png\");\n            }\n            Console.ReadKey();\n        }\n\t}\n\t\n\n\n### 安装方法\n\n- 首先肯定是要去上面这些平台中的一个注册下账号（开发者账号和普通账号都需要注册）；\n- 其次是将开发者账号中的软件ID、软件Key复制出来；\n- 然后登陆普通账号充值1~10元；\n- 接着将ThirdPartLibrary文件夹下的DLL类库复制到Wesley.Component.Captcha.Example项目下的bin\\debug目录下；\n- 若该项目下没有bin\\debug文件夹，请重新生成解决方案后再复制过去；\n- 最后运行Wesley.Component.Captcha.Example示例项目，按注释设置软件ID、软件Key、账号、密码、验证码类型就可以开始识别了；\n\n\n### 如何增加新的验证码平台？\n\n- 在项目里的Strategies文件夹中创建新平台的文件夹，名字随意例如：YouYouYun；\n- 在YouYouYun文件夹中创建一个继承至IStrategy接口并且后缀为Strategy的策略类如：YouYouYunStrategy.cs；\n- 按照其他文件夹中策略类中的实现方式来实现这个类，如果第三方平台有DLL记得复制到bin\\debug目录下去；\n- 修改项目中的Platform.cs文件，增加新的枚举类型YouYouYun；\n- 程序实例化时将自动查找包含YouYouYun关键字的策略类并实例化，调用其识别方法；\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrofisher%2FCaptcha-Recognizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicrofisher%2FCaptcha-Recognizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrofisher%2FCaptcha-Recognizer/lists"}