21,887
社区成员
发帖
与我相关
我的任务
分享
HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create("http://localhost:81/console_revised/" + page);
data = encoding.GetBytes(postData);
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);
string content = reader.ReadToEnd();
reader.Close();
myResponse.Close();