111,129
社区成员
发帖
与我相关
我的任务
分享
string code="GBK";
string step = "2";
string lgt = "0";
string strId = txtName.Text;
string strPassword = txtPwd.Text;
string question = "0";
string customquest = "";
string answer = "";
string hideid = "";
string cktime = "31536000";
string submit = "";
ASCIIEncoding encoding = new ASCIIEncoding();
string postData = "forward=&jumpurl=http%3A%2F%2Fwww.tphou.com%2Fbbs%2Fmode.php%3Fm%3Do&step=" + step;
postData += ("&lgt="+lgt);
postData += ("&pwuser=" + strId);
postData += ("&pwpwd=" + strPassword);
postData += ("&question=" + question);
postData += ("&customquest=" + customquest);
postData += ("&answer=" + answer);
postData += ("&hideid=" + hideid);
postData += ("&cktime=" + cktime);
postData += ("&submit=" + submit);
byte[] data = encoding.GetBytes(postData);
HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create("http://tphou.com/bbs/login.php");
myRequest.Method = "POST";
myRequest.ContentType = "application/x-www-form-urlencoded";
myRequest.ContentLength = data.Length;
Stream newStream = myRequest.GetRequestStream();
newStream.Write(data, 0, data.Length);
newStream.Close();
HttpWebResponse myResponse = (HttpWebResponse)myRequest.GetResponse();
StreamReader reader = new StreamReader(myResponse.GetResponseStream(), Encoding.GetEncoding(code));
string content = reader.ReadToEnd();
riBox.Text = content;