System.Net.ServicePointManager.ServerCertificateValidationCallback += delegate
(object sender, X509Certificate certificate, X509Chain chain,
SslPolicyErrors sslPolicyErrors)
{ return true; };
var parameters = "go=1";
var cred = new NetworkCredential();
cred.Password = "demo"
cred.UserName = "admin"
var request = (HttpWebRequest)HttpWebRequest.Create("https://www.google.com");
request.AllowAutoRedirect = false;
request.ContentType = "application/x-www-form-urlencoded";
request.Credentials = cred;
request.Method = "POST";
request.UserAgent = "Vargonen/0.1";
request.ContentLength = parameters.Length;
var reqStream = request.GetRequestStream();
reqStream.Write(parameters, 0, parameters.Length);
reqStream.Close();
var response = (HttpWebResponse)request.GetResponse();
var sr = new StreamReader(response.GetResponseStream());
var htmlText = sr.ReadToEnd().Trim();
Hiç yorum yok:
Yorum Gönder