日期:2014-05-17 浏览次数:20464 次
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain";
string postStr = "";
if (context.Request.HttpMethod.ToLower() == "post")
{
//System.IO.Stream s = System.Web.HttpContext.Current.Request.InputStream;
System.IO.Stream s = context.Request.InputStream;
NameValueCollection nvc = context.Request.Headers;
string weixinXML = nvc.Get(null);
new BLL_T_MEssage().AddNew(weixinXML);//存入数据库
//nvc.GetObjectData(
//context.Request.
byte[] b = new byte[s.Length];
s.Read(b, 0, (int)s.Length);
postStr = System.Text.Encoding.UTF8.GetString(b);
if (!string.IsNullOrEmpty(postStr))
{
new BLL_T_MEssage().AddNew(weixinXML);//存入数据库
context.Response.End();
}
}
//else
//{ Valid(context); }
}