小小博客

  • 首页
  • 关于博客
  • 个人日志
  • VPS代理
小小博客
WIKI Tool For MMN6.COM
  1. 首页
  2. 个人日志
  3. 正文

c# Google验证码打码实现

2024年2月23日 826点热度 0人点赞 0条评论
/**********
* typeId 请求类型
* siteKey GOOGLE验证码KEY
* siteReferer 当前URL
**********/
private static string ReCaptcha(int typeId, String siteKey, String siteReferer = "")
        {
            // 识别
            string authorization = "xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx";
            string requestUrl = "{\"captchaType\": \"ReCaptchaV2\", \"useCache\": \"true\", \"developer\": \"yyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyy\", \"siteKey\": \"" + siteKey + "\", \"siteReferer\": \"" + siteReferer + "\" }";
            if (typeId == 1)
            {
                requestUrl = siteKey;
            }
            //json
            string joSuccess = "";
            //
            string joResult = "";
            JObject jo = null;
            try
            {
                string jsonStr = "";
                if (typeId == 1)
                {
                    jsonStr = GetHtmlGet(requestUrl);//请求url
                    jo = Jsons.ToJObject(jsonStr);
                    joSuccess = jo["status"].ToString().ToLower();
                }
                else
                {
                    jsonStr = GetHtmlPost(requestUrl);//请求url
                    jo = Jsons.ToJObject(jsonStr);
                    joSuccess = jo["taskId"].ToString().ToLower();
                }
                Console.WriteLine(joSuccess);
            }
            catch { }
            //识别成功
            if (joSuccess != "")
            {
                // 平台返回的识别结果
                if (typeId == 1)
                {
                    if (jo["status"].ToString().ToLower() == "fail")
                    {
                        joResult = "fail";
                    }
                    else if (jo["status"].ToString().ToLower() == "success")
                    {
                        joResult = jo["response"]["gRecaptchaResponse"].ToString();
                    }
                }
                else
                {
                    joResult = joSuccess;
                }
                Console.WriteLine(joResult);
                return joResult;
            }
            else
            {
                // 未知异常,一般不会出现
                Console.WriteLine("未知异常");
            }
            return "";
        }

Captcha打码注册平台注册 =》 查看

标签: 暂无
最后更新:2025年6月4日

MMN6

格局

点赞
< 上一篇
下一篇 >

文章评论

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回复
分类目录
  • Windows
  • Liunx
  • VPS代理
  • 个人日志
  • 海外电商
  • 社会百态
标签聚合
Firefox ubuntu AI Android vs2022 SecureCRT c# Deepfacelab
最新 热点 随机
最新 热点 随机
Shell命令处理大数据分割 Notepad++ 替换空格乱码 3proxy 代理使用 Android Pixel 刷机+root Visual Studio VS2022 激活密钥 WIN10系统点不开开始菜单和右下角日期解决办法
Notepad++ 替换空格乱码Shell命令处理大数据分割
MYSQL大数据快速导出 Ubuntu22安装PHP环境 C# Selenium 页面滚动到底部 新版Photoshop修改颜色时出现感叹号的解决方法 Sublime Text4 4180版本方法 magento常用命令

COPYRIGHT © 2005 - 2025 小小博客. ALL RIGHTS RESERVED.