C# 中ashx文件中的代码 请教大家解释一下什么意思? 谢谢 本人是菜鸟。
publicclassRTService:IHttpHandler{publicvoidProcessRequest(HttpContextcontext){string...
public class RTService : IHttpHandler {
public void ProcessRequest (HttpContext context) {
string value = "";
string type= context.Server.UrlDecode(context.Request.Params["type"]);
string param=context.Server.UrlDecode(context.Request.Params["param"]);
string op = context.Server.UrlDecode(context.Request.Params["op"]);
string callback = context.Server.UrlDecode(context.Request.Params["callback"]);
switch (type)
{
case "enviro":
value = Environment.doQuery(op, param);
break;
}
if (callback != null)
value = callback + "&&" + callback + "(" + value + ")";
context.Response.Write(value);
}
public bool IsReusable {
get {
return false;
}
}
} 展开
public void ProcessRequest (HttpContext context) {
string value = "";
string type= context.Server.UrlDecode(context.Request.Params["type"]);
string param=context.Server.UrlDecode(context.Request.Params["param"]);
string op = context.Server.UrlDecode(context.Request.Params["op"]);
string callback = context.Server.UrlDecode(context.Request.Params["callback"]);
switch (type)
{
case "enviro":
value = Environment.doQuery(op, param);
break;
}
if (callback != null)
value = callback + "&&" + callback + "(" + value + ")";
context.Response.Write(value);
}
public bool IsReusable {
get {
return false;
}
}
} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询