获取post传输参数

1.获取post参数可以用

传输参数为 a=aa&b=bb这种

public static SortedDictionary<string, string> GetRequestPost() {
//throw new NotImplementedException(); int i = ;
SortedDictionary<string, string> sArray = new SortedDictionary<string, string>();
NameValueCollection coll;
//Load Form variables into NameValueCollection variable.
coll = HttpContext.Current.Request.Form; // Get names of all forms into a string array.
String[] requestItem = coll.AllKeys; for (i = ; i < requestItem.Length; i++) {
sArray.Add(requestItem[i], HttpContext.Current.Request.Form[requestItem[i]]);
} return sArray;
}

接收可以用:SortedDictionary<string, string> sArrary = AA.GetRequestPost();

链接:https://share.weiyun.com/5sCiWVX

上一篇:008.CI4框架CodeIgniter, Controller控制器传输参数到View视图


下一篇:SSH 配置