异步页写接口.ashx文件
作者:
wppeng | 来源:发表于
2017-10-24 20:52 被阅读0次前部代码配置
public HttpRequest Request { get { return HttpContext.Current.Request; } }
public HttpResponse Response { get { return HttpContext.Current.Response; } }
public string usercode { get; set; }
public void ProcessRequest (HttpContext context) {
context.Response.ContentType = "text/plain";
context.Response.Cache.SetNoStore();
String methodName = context.Request["method"];
if (String.IsNullOrEmpty(methodName)) return;
if (!string.IsNullOrEmpty(Request.Params["UserCode"]))
{
usercode = Request.Params["UserCode"].ToString();
}
Type type = this.GetType();
MethodInfo method = type.GetMethod(methodName);
method.Invoke(this, null);
}
/// <summary>
/// 根据判断获取新闻数据列表
/// </summary>
public void GetBind()
{
//相应方法,根据?method=GetBind访问
}
本文标题:异步页写接口.ashx文件
本文链接:https://www.haomeiwen.com/subject/fmnxpxtx.html
网友评论