public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain";
try
{
string action = context.Request.QueryString["action"];
if (!string.IsNullOrEmpty(action))
{
switch (action)
{
case "RPA":
HandleRPA(context);
break;
case "17track":
Handle17track(context);
break;
case "51track":
Handle51track(context);
break;
// 添加更多接口逻辑以处理其他操作参数
default:
context.Response.StatusCode = 400; // Bad Request
context.Response.Write("Invalid action");
break;
}
}
else
{
context.Response.StatusCode = 500;
context.Response.Write("Action parameter missing");
ExceptionlessManager.WriteExceptionLog("Service_TrackingMore", "Action parameter missing", null, AllProjectsKey.OrderDownLoad.ToString());
}
}
catch (Exception ex)
{
ExceptionlessManager.WriteExceptionLog("Service_TrackingMore", $"异常:{ex}", null, AllProjectsKey.OrderDownLoad.ToString());
context.Response.Write($"异常:{ex}");
}
}
标签:Write,请求,break,获取,ashx,ex,context,action,Response
From: https://www.cnblogs.com/BOSET/p/17826123.html