public class Public
    {
        private static Public _instance = new Public();

        /// <summary>
        /// 全局访问点
        /// </summary>
        public static Public Instance
        {
            get
            {
                return _instance;
            }
        }

        /// <summary>
        /// 解析post流数据 
        /// </summary>
        /// <returns></returns>
        public string ShowUrlPostData()
        {
            try
            {
                Stream s = HttpContext.Current.Request.InputStream;
                byte[] result_byte = new byte[1024];
                MemoryStream ms = new MemoryStream();
                int count = s.Read(result_byte, 0, result_byte.Length);
                while (count != 0)
                {
                    ms.Write(result_byte, 0, count);
                    count = s.Read(result_byte, 0, result_byte.Length);
                }
                string json_result = HttpUtility.UrlDecode(Encoding.UTF8.GetString(ms.ToArray())).Trim('=');
                return json_result;
            }
            catch { }
            return "";
        }
    }

 

相关文章:

  • 2022-12-23
  • 2022-02-24
  • 2022-12-23
  • 2021-11-21
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-09
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案