public void ProcessRequest(HttpContext context) { try { //实例化CallbackManager CallbackManager cm = new CallbackManager(); cm.EnablePositionRecord = true; //开启位置记录功能 cm.PositionRecordExpiresHours = 24; //记录缓存有效时间(可不设置,默认为24小时) //注册事件 cm.ProcessingEventClick += cm_ProcessingEventClick; cm.ProcessingText += cm_ProcessingText; cm.ProcessingImage += cm_ProcessingImage; cm.ProcessingLocation += cm_ProcessingLocation; cm.ProcessingEventBatchJobResult += cm_ProcessingEventBatchJobResult; //..... //其他类型注册和处理方法相同 省略 //只需注册需要处理的事件 //最后执行Processing方法开始处理 cm.Processing(); } catch (Exception ex)//ex.Message 异常信息 { Logger.Error(ex); //todo... //... } }
public void ProcessRequest(HttpContext context) { Logger.Log("【IM】" + context.Request.Url); CallbackManager cm = new CallbackManager(); cm.Processing(); //context.Response.ContentType = "text/plain"; //context.Response.Write("Hello World"); }