1.获取post参数可以用
传输参数为 a=aa&b=bb这种
public static SortedDictionary<string, string> GetRequestPost() { //throw new NotImplementedException(); int i = 0; 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 = 0; 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