using BaicWcfService.DataObjects;
using System;
using System.Web;
namespace BaicWcfService
{
public class HttpModuleLog : IHttpModule
{
public void Dispose()
{
throw new NotImplementedException();
}
public void Init(HttpApplication context)
{
//BeginRequest
context.BeginRequest += context_BeginRequest;
//AuthenticateRequest
context.AuthenticateRequest += context_AuthenticateRequest;
//PostAuthenticateRequest
context.PostAuthenticateRequest += context_PostAuthenticateRequest;
}
void context_PostAuthenticateRequest(object sender, EventArgs e)
{
SequenceLogDataObject log = new SequenceLogDataObject
{
SeriID = "3",
RequestContent = "context_PostAuthenticateRequest",
ResponseContent = "context_PostAuthenticateRequest",
ReceiveDateTime = DateTime.Now
};
Log.AddSequenceLog(log);
}
void context_AuthenticateRequest(object sender, EventArgs e)
{
SequenceLogDataObject log = new SequenceLogDataObject
{
SeriID = "2",
RequestContent = "context_AuthenticateRequest",
ResponseContent = "context_AuthenticateRequest",
ReceiveDateTime = DateTime.Now
};
Log.AddSequenceLog(log);
}
void context_BeginRequest(object sender, EventArgs e)
{
HttpApplication app = new HttpApplication();
HttpResponse Response = HttpContext.Current.Response;
SequenceLogDataObject log = new SequenceLogDataObject
{
SeriID = "1",
RequestContent = "context_BeginRequest",
ResponseContent = "context_BeginRequest",
ReceiveDateTime = DateTime.Now
};
Log.AddSequenceLog(log);
}
}
}