using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Security; using System.Web.SessionState; namespace KJD_Web { public class Global : System.Web.HttpApplication { protected void Application_Start(object sender, EventArgs e) { } protected void Session_Start(object sender, EventArgs e) { } protected void Application_BeginRequest(object sender, EventArgs e) { string hPath = Request.Url.LocalPath.ToString(); if (!hPath.Contains(".asmx") && hPath.Contains("/user/")) { hPath = hPath.Replace("/user/", "/UserService.asmx/"); Context.RewritePath(hPath); } else if (!hPath.Contains(".asmx") && hPath.Contains("/shop/")) { hPath = hPath.Replace("/shop/", "/ShopService.asmx/"); Context.RewritePath(hPath); } else if (!hPath.Contains(".asmx") && hPath.Contains("/update/")) { hPath = hPath.Replace("/update/", "/UpdateService.asmx/"); Context.RewritePath(hPath); } else if (!hPath.Contains(".asmx") && hPath.Contains("/product/")) { hPath = hPath.Replace("/product/", "/ProductService.asmx/"); Context.RewritePath(hPath); } else if (!hPath.Contains(".asmx") && hPath.Contains("/product_third/")) { hPath = hPath.Replace("/product_third/", "/ProductThirdService.asmx/"); Context.RewritePath(hPath); } else if (!hPath.Contains(".asmx") && hPath.Contains("/price/")) { hPath = hPath.Replace("/price/", "/PriceService.asmx/"); Context.RewritePath(hPath); } } protected void Application_AuthenticateRequest(object sender, EventArgs e) { } protected void Application_Error(object sender, EventArgs e) { } protected void Session_End(object sender, EventArgs e) { } protected void Application_End(object sender, EventArgs e) { } } }