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("/order/")) { hPath = hPath.Replace("/order/", "/OrderService.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); } if (!hPath.Contains(".asmx") && hPath.Contains("/bxx_user/")) { hPath = hPath.Replace("/bxx_user/", "/BXXUserService.asmx/"); Context.RewritePath(hPath); } else if (!hPath.Contains(".asmx") && hPath.Contains("/bxx_shop/")) { hPath = hPath.Replace("/bxx_shop/", "/BXXShopService.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("/bxx_product/")) { hPath = hPath.Replace("/bxx_product/", "/BXXProductService.asmx/"); Context.RewritePath(hPath); } else if (!hPath.Contains(".asmx") && hPath.Contains("/bxx_product_third/")) { hPath = hPath.Replace("/bxx_product_third/", "/BXXProductThirdService.asmx/"); Context.RewritePath(hPath); } else if (!hPath.Contains(".asmx") && hPath.Contains("/bxx_price/")) { hPath = hPath.Replace("/bxx_price/", "/BXXPriceService.asmx/"); Context.RewritePath(hPath); } if (!hPath.Contains(".asmx") && hPath.Contains("/dyxd_user/")) { hPath = hPath.Replace("/dyxd_user/", "/DYUserService.asmx/"); Context.RewritePath(hPath); } else if (!hPath.Contains(".asmx") && hPath.Contains("/dyxd_shop/")) { hPath = hPath.Replace("/dyxd_shop/", "/DYShopService.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("/dyxd_product/")) { hPath = hPath.Replace("/dyxd_product/", "/DYProductService.asmx/"); Context.RewritePath(hPath); } else if (!hPath.Contains(".asmx") && hPath.Contains("/dyxd_product_third/")) { hPath = hPath.Replace("/dyxd_product_third/", "/DYProductThirdService.asmx/"); Context.RewritePath(hPath); } else if (!hPath.Contains(".asmx") && hPath.Contains("/dyxd_price/")) { hPath = hPath.Replace("/dyxd_price/", "/DYPriceService.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) { } } }