Exemplo n.º 1
0
 /// <summary>
 /// ashx程序入口方法
 /// </summary>
 /// <param name="context"></param>
 public void ProcessRequest(HttpContext context)
 {
     try
     {
         Log4netInit();
         context.Response.ContentType = "text/plain";
         string           interfaceName   = context.Request.Form["interfaceName"];
         string           applicationName = context.Request.Form["applicationName"];
         string           server          = context.Request.Form["server"];
         int              stateCode       = !string.IsNullOrEmpty(context.Request.Form["stateCode"]) ? Int32.Parse(context.Request.Form["stateCode"]) : 0;
         string           exceptionInfo   = context.Request.Form["exceptionInfo"];
         InterfaceMonitor client          = new InterfaceMonitor();
         if (!string.IsNullOrEmpty(exceptionInfo))
         {
             client.UpdateInterfaceRealtimeInfoWithExceptionService(interfaceName, applicationName, server, stateCode, exceptionInfo);
             log.Info(string.Format("InterfaceMonitor.ashx   UpdateInterfaceRealtimeInfoWithExceptionService({0},{1},{2},{3},{4})调用成功!", interfaceName, applicationName, server, stateCode, exceptionInfo));
         }
         else
         {
             client.UpdateInterfaceRealtimeInfoService(interfaceName, applicationName, server, stateCode);
             log.Info(string.Format("InterfaceMonitor.ashx   UpdateInterfaceRealtimeInfoService({0},{1},{2},{3})调用成功!", interfaceName, applicationName, server, stateCode));
         }
     }
     catch (Exception ex)
     {
         log.Error(string.Format("InterfaceMonitor.ashx接口调用发生异常,异常信息为:{0}", ex));
     }
 }