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");////// }
}
}
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");////// }
}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货