Skip to content

Instantly share code, notes, and snippets.

@ekaraman89
Last active February 25, 2020 09:13
Show Gist options
  • Save ekaraman89/c22c7a4f30e49e116b19b4564dab9b4d to your computer and use it in GitHub Desktop.
Save ekaraman89/c22c7a4f30e49e116b19b4564dab9b4d to your computer and use it in GitHub Desktop.
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