string url = "
http://localhost/index.php">
http://localhost/index.php";
HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(url);
req.Method = "Post";
req.Accept=@"image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*";
req.ContentType = "application/x-www-form-urlencoded";
req.Referer = @"
http://localhost/index.php?module=user&action=login">
http://localhost/index.php?module=user&action=login";
req.ProtocolVersion = new Version("1.1");
req.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; .NET CLR 2.0.50727)";
req.KeepAlive = true;
string data = this.PostString();
byte[] buffer = Encoding.UTF8.GetBytes(data);
req.ContentLength = buffer.Length;
using (Stream reqst = req.GetRequestStream()) {
reqst.Write(buffer, 0, buffer.Length);
}
using (HttpWebResponse res = (HttpWebResponse)req.GetResponse()) {
string result;
using (Stream resst = res.GetResponseStream()) {
result = new StreamReader(resst).ReadToEnd();
}
webBrowser1.DocumentText = result;
}