public void ProcessRequest(HttpContext context)
{
//WHC.Framework.Commons.LogTextHelper.Info("测试记录");
string postString = string.Empty;
if (HttpContext.Current.Request.HttpMethod.ToUpper() == "POST")
{
using (Stream stream = HttpContext.Current.Request.InputStream)
{
Byte[] postBytes = new Byte[stream.Length];
stream.Read(postBytes, 0, (Int32)stream.Length);
postString = Encoding.UTF8.GetString(postBytes);
}
if (!string.IsNullOrEmpty(postString))
{
Execute(postString);
}
}
else
{
Auth();
}
}
/// <summary>
/// 处理各种请求信息并应答(通过POST的请求)
/// </summary>
/// <param name="postStr">POST方式提交的数据</param>
private void Execute(string postStr)
{
WeixinApiDispatch dispatch = new WeixinApiDispatch();
string responseContent = dispatch.Execute(postStr);
HttpContext.Current.Response.ContentEncoding = Encoding.UTF8;
HttpContext.Current.Response.Write(responseContent);
}
/// <summary>
/// 客户端请求的数据接口
/// </summary>
public interface IWeixinAction
{
/// <summary>
/// 对文本请求信息进行处理
/// </summary>
/// <param name="info">文本信息实体</param>
/// <returns></returns>
string HandleText(RequestText info);
/// <summary>
/// 对图片请求信息进行处理
/// </summary>
/// <param name="info">图片信息实体</param>
/// <returns></returns>
string HandleImage(RequestImage info);
...........................
/// <summary>
/// 对订阅请求事件进行处理
/// </summary>
/// <param name="info">订阅请求事件信息实体</param>
/// <returns></returns>
string HandleEventSubscribe(RequestEventSubscribe info);
/// <summary>
/// 对菜单单击请求事件进行处理
/// </summary>
/// <param name="info">菜单单击请求事件信息实体</param>
/// <returns></returns>
string HandleEventClick(RequestEventClick info);
..............................
}
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有