1

我们目前正在使用 reCAPTCHA 版本 1,并且出现了该错误(reCAPTCHA V1 IS SHUTDOWN)。

我们目前正在为 ASP.Net 使用 Recaptcha.dll(产品版本 1.0.0.0)。
如何将此更新到当前版本。他们的下载页面中没有更新版本的dll。

https://code.google.com/archive/p/recaptcha/downloads

我们目前在标签内使用普通的 reCAPTCHA 控件。

 <%@ Register TagPrefix="recaptcha" Namespace="Recaptcha" Assembly="Recaptcha" %>

<recaptcha:RecaptchaControl
ID="recaptcha"
runat="server"
PublicKey="your_public_key"
PrivateKey="your_private_key"
/>
4

1 回答 1

0

从版本 2 开始,没有针对 asp.net 网络表单的定制 Nuget 包或库。您必须使用文档中列出的方法并迁移到版本 2,更好的 v3。

因此,转到您在 google 的管理面板,获取新库,然后您所要做的就是在您的页面上添加一些 html 标记:

<body>
    <form action="/" method="POST">
        <div class="g-recaptcha" data-sitekey="xxxx-xxxx-xxxx-xxxx"></div>
        <input type="submit" value="Submit">
    </form>

    <script src="https://www.google.com/recaptcha/api.js" async defer></script>
</body>

对于 v3,它看起来像这样:

<script src="https://www.google.com/recaptcha/api.js?render=xxxx-xxxx-xxxx-xxxx"></script>
<script>
    grecaptcha.ready(function() {
    grecaptcha.execute('xxxx-xxxx-xxxx-xxxx', {action: 'homepage'}).then(function(token) {
         ...
    });
});
</script>

用您的特定密钥替换 data-sitekey 属性,您应该已经启动并运行。

v2 参考:https ://developers.google.com/recaptcha/docs/display

v3 参考:https ://developers.google.com/recaptcha/docs/v3

于 2019-01-02T07:49:18.240 回答