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

相关文章:

  • 2021-09-26
  • 2022-12-23
  • 2020-02-02
  • 2021-07-05
  • 2021-10-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-08-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案