请问如何接受Post方法传过来的数据
我要做一个页面test.aspx用来接收这个函数提交的数据如何实现?
private void SendWebRequest()
{
string msgid, srcid, destid, content;
msgid = "1 ";
srcid = "2 ";
destid = "3 ";
content = "4 ";
string reqData = @ " <?xml version= " "1.0 " " encoding= " "GB2312 " "?>
<submit_sms>
<cp_id> ##CPID## </cp_id>
<cp_msg_id> ##MSGID## </cp_msg_id>
<SrcTermId> ##SRCID## </SrcTermId>
<DestTermId> ##DESTID## </DestTermId>
<FeeType> 101 </FeeType>
<content> <![CDATA[##Content##]]> </content>
</submit_sms>
";
reqData = reqData.Replace( "##CPID## ", "7777 ");
reqData = reqData.Replace( "##MSGID## ", msgid.ToString());
reqData = reqData.Replace( "##SRCID## ", srcid.ToString());
reqData = reqData.Replace( "##DESTID## ", destid.ToString());
reqData = reqData.Replace( "##Content## ", content.ToString());
HttpWebRequest req = (HttpWebRequest)WebRequest.Create( "http://127.0.0.1:1673/Sms/test.aspx ");
req.Method = "POST ";
req.Accept = "*/* ";
req.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322) ";
req.Headers.Add( "ContentType ", "application/x-www-form-urlencoded ");
StreamWriter reqStm = new StreamWriter(req.GetRequestStream());
reqStm.Write(reqData);
HttpWebResponse rsp = (HttpWebResponse)req.GetResponse();
if (rsp.StatusCode != HttpStatusCode.OK)
{
//TODO:
}
else
&n