Пример #1
0
 public void Update(int responselog)
 {
     HttpContext context = HttpContext.Current;
     ELSLog esLog = new ELSLog();
     esLog = (ELSLog)context.Items[Userlog];
     esLog.ElsResponse = responselog;
 }
Пример #2
0
        public void Save(string ipAddress, HttpContext context, HttpRequest request, HttpResponse response)
        {
            ELSLog esLog = new ELSLog();
            esLog.ElsIpaddress = ipAddress;
            /*  var x = request.Path;

              x = Getapifunction(x);

              switch (request.HttpMethod)
              {
                  case "GET" :
                      x = "SEE " + x;
                      break;
                  case "POST":
                      x = "SENT " + x;
                      break;
              }*/
            // if (x == "/api/contact")
            // {
            //     x = "sendqueue";}
            esLog.ElsRequest = "[" + DateTime.Now.ToString("dd/MMM/yyyy:HH:mm:ss zz") + "]" + " \"" + request.HttpMethod + " "
                + request.Path + "\" " + response.StatusCode + " " + request.TotalBytes + " \"" + request.UrlReferrer + "\" " + "\"" + request.UserAgent + "\"" + " " + request.Form;

            /*    if (HttpContext.Current.Session != null)
                {
                   // context.Session[Userlog] = esLog;
                    Session[Userlog] = esLog;
                }*/
            context.Items[Userlog] = esLog;
        }