C# 一般处理程序后台传来参数作为方法Act

    xiaoxiao2021-12-13  22

    private HttpRequest req; private HttpResponse res; private HttpContext ctx; public void ProcessRequest(HttpContext context) { this.ctx = context; this.req = ctx.Request; this.res = ctx.Response; res.ContentType = "text/plain"; string act = req["act"]; if (string.IsNullOrEmpty(act)) { res.Write("没有参数"); } else { Type type = this.GetType(); MethodInfo method = type.GetMethod(act); if (method != null) { method.Invoke(this, null); } else { res.Write("没有这个方法"); } } res.End(); }
    转载请注明原文地址: https://ju.6miu.com/read-950279.html

    最新回复(0)