private string VerifyRecaptcha(string secret, string responseCode) { WebRequest request = WebRequest.Create("https://www.google.com/recaptcha/api/siteverify"); request.Method = "POST"; string postData = "secret=" + secret + "&response=" + responseCode; byte[] byteArray = Encoding.UTF8.GetBytes(postData); request.ContentType = "application/x-www-form-urlencoded"; request.ContentLength = byteArray.Length; Stream dataStream = request.GetRequestStream(); dataStream.Write(byteArray, 0, byteArray.Length); dataStream.Close(); WebResponse response = request.GetResponse(); dataStream = response.GetResponseStream(); StreamReader reader = new StreamReader(dataStream); string responseFromServer = reader.ReadToEnd(); reader.Close(); dataStream.Close(); response.Close(); return responseFromServer; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)