jt
2021-06-10 5d0d028456874576560552f5a5c4e8b801786f11
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
using System;
using System.Web;
using System.Text.RegularExpressions;
using System.Web.UI.HtmlControls;
using System.IO;
using System.IO.Compression;
using System.Web.UI.WebControls;
using System.Text;
using System.Collections.Generic;
 
namespace HH.WMS.Utils
{
    /// <summary>
    /// WEB请求上下文信息工具类
    /// </summary>
    public partial class ZHttp
    {
        #region 判断当前页面是否接收到了Post请求
        /// <summary>
        /// 判断当前页面是否接收到了Post请求,如果当前请求不存在,返回false
        /// </summary>
        /// <returns>是否接收到了Post请求</returns>
        public static bool IsPost
        {
            get
            {
                return HttpContext.Current.Request.HttpMethod.Equals("POST");
            }
        }
        #endregion
 
        #region 判断当前页面是否接收到了Get请求
        /// <summary>
        /// 判断当前页面是否接收到了Get请求,如果当前请求不存在,返回 false
        /// </summary>
        /// <returns>是否接收到了Get请求</returns>
        public static bool IsGet
        {
            get
            {
                return HttpContext.Current.Request.HttpMethod.Equals("GET");
            }
        }
        #endregion
 
        #region 获取客户端使用的HTTP数据传输方法
        /// <summary>
        /// 获取客户端使用的HTTP数据传输方法 
        /// </summary>
        public static string Method
        {
            get
            {
                return HttpContext.Current.Request.HttpMethod;
            }
        }
        #endregion
    }
}