日期:2014-05-17 浏览次数:21323 次
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://www.m8iu.com/member.php?mod=register&inajax=1");
request.Method = "POST";
request.CookieContainer = cookie;
request.ContentType = "multipart/form-data; boundary=---------------------------7ddc8a806ce";
request.Connection = "Keep - Alive";
request.UserAgent = "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)";
request.Referer = "http://m8iu.com/member.php?mod=register";
request.Accept = "text/html, application/xhtml+xml, */*";
string str = textBox1.Text.Replace("{name}","asdasd");
str = str.Replace("{pwd}","521521");
str = str.Replace("{youjian}","asdasdas@qq.com");
byte[] b=Encoding.UTF8.GetBytes(str);
request.GetRequestStream().Write(b,0,b.Length);
request.GetRequestStream().Close();
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
System.IO.StreamReader read = new System.IO.StreamReader(response.GetResponseStream());
MessageBox.Show(read.ReadToEnd());