C# ashx接收ContentType="text/xml"类型值
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; System.IO.Stream s = context.Request.InputStream; int count = 0; byte[] buffer = new byte[1024]; StringBuilder builder = new StringBuilder(); while ((count = s.Read(buffer, 0, 1024)) > 0) { builder.Append(Encoding.UTF8.GetString(buffer, 0, count)); } s.Flush(); s.Close(); s.Dispose(); context.Response.Write(builder.ToString()); }