using System;
using System.Web;
using System.Security.Principal;
using System.Diagnostics;namespace MyModule
{
public class SyncModule : IHttpModule
{
private HttpApplication httpApp; public void Init(HttpApplication httpApp)
{
this.httpApp = httpApp;
//httpApp.AuthenticateRequest  += new EventHandler(OnAuthentication);//在Init方法中注册AuthenticateRequest事件
}
         

void OnAuthentication(object sender, EventArgs a)
{
HttpApplication application = (HttpApplication)sender;
HttpResponse response = application.Context.Response;
WebReference.UserServiceBinding binding = new      WebReference.UserServiceBinding();
WebReference.User user=binding.Authenticate(application.Request.Params.Get("token"),application.Request.UserHostAddress);//用代理类调用webSercice的方法

if (user==null)
{
response.Redirect("fail.htm");
////// response.Redirect("fail.aspx");////// }

else
{
response.Redirect (pass.htm);
                  ////// response.Redirect("pass.aspx");////// }  
}
}