HttpWebRequest httprequest;
HttpWebResponse httpresponse;
StreamReader bodyreader;
string bodytext = "";
Stream responsestream;
Stream requestStream;
httprequest = (HttpWebRequest) WebRequest.Create(szURL);
httprequest.Method = "POST"; //跑送方法 get 和post
httprequest.ContentType ="application/x-www-form-urlencoded";
httprequest.ContentLength = szPost.Length;
requestStream = httprequest.GetRequestStream();
requestStream.Write(Encoding.ASCII.GetBytes(szPost),0,szPost.Length);
requestStream.Close();
httpresponse = (HttpWebResponse) httprequest.GetResponse();
responsestream = httpresponse.GetResponseStream();
bodyreader = new StreamReader(responsestream);
bodytext = bodyreader.ReadToEnd();
return bodytext;