ASP.NET(C#)取得post请求的所有参数

string postParam = ""; //post的所有参数

using (System.IO.StreamReader sr = new System.IO.StreamReader(Request.InputStream))

{

    postParam = sr.ReadLine();

}

 

获取结果如:account=496087321&productType=V2&productdesc=1。

Request.InputStream:获取传入的 HTTP 实体主体的内容。

来源: 谢斌个人博客ASP.NET(C#)取得post请求的所有参数
转载请以链接形式标明本文地址!本文地址:https://www.xb02.com/article/149
发表评论

发表评论