往一个url里发post,可以得到返回页面的html文本,怎么把这些html文本显示成一个页面,就是post请求后得到一个页面?
public string GetXmlBack(string url,string strXml)
{
string sRtn="";
WebResponse res=null;
WebRequest req=WebRequest.Create(url);
req.Method="POST";
req.ContentType="application/x-www-form-urlencoded";
byte[] bt=null;
bt=Encoding.GetEncoding("gb2312").GetBytes(strXml);
req.ContentLength=bt.Length;
Stream stm=req.GetRequestStream();
stm.Write(bt,0,bt.Length);
stm.Close();
res=req.GetResponse();
Encoding encode=System.Text.Encoding.GetEncoding("GB2312");
StreamReader stmR=new StreamReader(res.GetResponseStream(),encode);
sRtn=stmR.ReadToEnd();
stmR.Close();
return sRtn;
}
怎么把接收到的sRtn显示成页面,就是post请求后得到一个页面?