Last active
February 25, 2020 09:13
-
-
Save ekaraman89/c22c7a4f30e49e116b19b4564dab9b4d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Net; | |
public class GoogleCaptha | |
{ | |
public static bool CheckCaptha(string response) | |
{ | |
//var response = Request["g-recaptcha-response"]; | |
string secretKey = "6LchxNsUAAAAAAM7bgBzOnwGmgVlUyppu6xNbcye"; | |
var client = new WebClient(); | |
var result = client.DownloadString($"https://www.google.com/recaptcha/api/siteverify?secret={secretKey}&response={response}"); | |
dynamic obj = System.Web.Helpers.Json.Decode(result); | |
return obj.success; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment