接收Post的數據

using System;
using System.IO;
using System.Text;

            string Content;
            string HttpMethod;
            string _InputStream;
            using (Stream MyStream = Request.InputStream)
            {
                byte[] _tmpData = new byte[MyStream.Length];
                MyStream.Read(_tmpData, 0, _tmpData.Length);
                HttpMethod = Request.HttpMethod;
                Content = Request.RequestContext.HttpContext.ToString();
                _InputStream = Encoding.UTF8.GetString(_tmpData);
            }
            Response.Write("HttpMethod:" + HttpMethod + "<br>Content:" + Content + "<br>InputStream:" + _InputStream);

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章