📄 defaulthandler.ashx.cs
字号:
using System;
using System.Data;
using System.Web;
using System.Collections;
using System.Xml;
namespace Linkedu.Web.WebWWW
{
/// <summary>
/// Summary description for $codebehindclassname$
/// </summary>
public class DefaultHandler : IHttpHandler
{
protected XmlDocument _xmlResult;
public void ProcessRequest(HttpContext context)
{
if (context.Request["T"] != null)
{//GET xmlhttp测试
context.Response.ContentType = "text/xml";
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.LoadXml(string.Format(@"<time>GET:{0}</time>", System.DateTime.Now));
xmlDoc.Save(context.Response.OutputStream);
context.Response.End();
}
else
{//POST xmlhttp测试
context.Response.ContentType = "text/xml";
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(context.Request.InputStream);
if (xmlDoc.DocumentElement.Name == "T")
{
xmlDoc.LoadXml(string.Format(@"<time>POST:{0}</time>", System.DateTime.Now));
xmlDoc.Save(context.Response.OutputStream);
context.Response.End();
}
}
}
public bool IsReusable
{
get
{
return false;
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -