Web/App_Code/HandlerBase.ashx.cs

(开头部分) 4KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

using System.Reflection;
using System.Collections.Specialized;

/// <summary>
///HandlerBase 的摘要说明
/// </summary>
public class HandlerBase : IHttpHandler
{
    /// <summary>
    /// 指定过来的http请求类型  主要指定action方法名称的接收方式 get 或者 post
    /// </summary>
    protected NameValueCollection _httpReuqest = HttpContext.Current.Request.Form;

    /// <summary>
    /// 指定返回头
    /// </summary>
    protected string _contentType = "text/plain";

    /// <summary>
    /// 指定接收action方法的参数名称
    /// </summary>
    protected string _actionName = "method";

    //获取当前的http context
    protected HttpContext Context
    {
        get
        {
            return HttpContext.Current;
        }
    }

    /// <summary>
    /// 返回的内容
    /// </summary>
    protected string _resultContent = "";

    public void ProcessRequest(HttpContext context)
    {
        //修改请求为相应的请求
        if ("get" == context.Request.RequestType.ToLower())
        {
            _httpReuqest = context.Request.QueryString;
        }
        else
        {
            if ("post" == context.Request.RequestType.ToLower())
            {
                _httpReuqest = context.Request.Form;
            }
        }
        
        context.Response.ContentType = this._contentType;

        try
后面还有 101 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。