ASP.NET·????????
???????????? ???????[ 2016/3/8 11:31:47 ] ??????????????????? .NET
??????????????UrlRoutingModule?????IHttpModule???????????????Init????????Щ????
????protected virtual void Init(HttpApplication application)
????{
????if (application.Context.Items[_contextKey] == null)
????{
????application.Context.Items[_contextKey] = _contextKey;
????application.PostResolveRequestCache += new EventHandler(this.OnApplicationPostResolveRequestCache);
????}
????}
???????7?????PostResolveRequestCache?????OnApplicationPostResolveRequestCache???????????????????????
public virtual void PostResolveRequestCache(HttpContextBase context)
{
RouteData routeData = this.RouteCollection.GetRouteData(context);
//???·???????????RouteData??
if (routeData != null)
{
IRouteHandler routeHandler = routeData.RouteHandler;
if (routeHandler == null)
{
throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture?? SR.GetString("UrlRoutingModule_NoRouteHandler")?? new object[0]));
}
if (!(routeHandler is StopRoutingHandler))
{
RequestContext requestContext = new RequestContext(context?? routeData);
context.Request.RequestContext = requestContext;
IHttpHandler httpHandler = routeHandler.GetHttpHandler(requestContext);
//??????????????IHttpHandler????
if (httpHandler == null)
{
object[] args = new object[] { routeHandler.GetType() };
throw new InvalidOperationException(string.Format(CultureInfo.CurrentUICulture?? SR.GetString("UrlRoutingModule_NoHttpHandler")?? args));
}
if (httpHandler is UrlAuthFailureHandler)
{
if (!FormsAuthenticationModule.FormsAuthRequired)
{
throw new HttpException(0x191?? SR.GetString("Assess_Denied_Description3"));
}
UrlAuthorizationModule.ReportUrlAuthorizationFailure(HttpContext.Current?? this);
}
else
{
context.RemapHandler(httpHandler);
//???????IHttpHandler??????????
}
}
}
}
???????????????????3????????·??→??????????????IHttpHandler????→???????IHttpHandler?????????????????11??12???????????IHttpHandler?????PR??????????????
?????????????????·??ASP.NET???????UrlRoutingModule??飬????????????IHttpModule????????Init?????????7????????????????????÷????????·???????????????????????RouteData?е?IHttpHandler?????????????????У???????????11??12???????????????IHttpHandler??????????
????????????????Route???????????????????IHttpHandler???????????
?????????·??????????????????????????????
????public class Global : System.Web.HttpApplication
????{
????protected void Application_Start(object sender?? EventArgs e)
????{
????var defaults = new RouteValueDictionary();
????defaults.Add("name"?? "*");
????//??????
????//???RouteTable????????Routes???????Route????????
????RouteTable.Routes.Add("app"?? new Route("app/{name}"?? defaults?? new MyRouteHandler()));
????//???????
????//???RouteTable????????Routes????????????????·?????
????RouteTable.Routes.MapPageRoute("default"?? "app/{name}"?? "~/WebForm1.aspx"?? false?? defaults);
????}
????}
???????????????????????????·??????????????????????д??MyRouteHandler?????????????????????????IRouteHandler?????????IHttpHandler????
????/// <summary>
????/// ?????IRouteHandler????????
????/// </summary>
????internal class MyRouteHandler : IRouteHandler
????{
????public IHttpHandler GetHttpHandler(RequestContext requestContext)
????{
????//???????Page???????????????
????return new WebForm1();
????}
????}
?????????????????б????????????????????·????????????????????Route??????
???????????????????????
????public Route MapPageRoute(string routeName?? string routeUrl?? string physicalFile?? bool checkPhysicalUrlAccess?? RouteValueDictionary defaults?? RouteValueDictionary constraints?? RouteValueDictionary dataTokens)
????{
????if (routeUrl == null)
????{
????throw new ArgumentNullException("routeUrl");
????}
????Route item = new Route(routeUrl?? defaults?? constraints?? dataTokens?? new PageRouteHandler(physicalFile?? checkPhysicalUrlAccess));
????this.Add(routeName?? item);
????return item;
????}
???????????е?·??????????????????????Route??????????в???physicalFile??checkPhysicalUrlAccess?????????PageRouteHandler???????????????£?
????public class PageRouteHandler : IRouteHandler
????{
????}
????????????????IRouteHandler????????????????????????????????IHttpHandler??????????£?
????[TypeForwardedFrom("System.Web.Routing?? Version=3.5.0.0?? Culture=Neutral?? PublicKeyToken=31bf3856ad364e35")]
????public interface IRouteHandler
????{
????// Methods
????IHttpHandler GetHttpHandler(RequestContext requestContext);
????}
??????????????????????????????????·??????????????Route????Route??GetRouteData???????????·????ο??????????Artech???鼮????·??????е?physicalFile??checkPhysicalUrlAccess????????????IHttpHandler?????????????????
???????ASP.NET??·?????????????
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
Asp.net MVC??ζ???????????????????????Trim????Asp.Net WebForm????????????asp.net ???????????Linux???Jexus?й?Asp.Net Core??ó???asp.net??????????????ASP.NET???????JSON????????????????ASP.NET MVC???????????Щ?£?Asp.net Core MVC?????SessionASP.NET Core???????7??????????????????[???]ASP.NET Core???????6??????????????????[???]ASP.NET Core???????5??????????????????ASP.NET???License Key??????ASP.NET Core 1.0?е???-?м????ASP.NET Core???????3???? ?????e??????[???]ASP.NET Core???????2??????????????ASP.NET?е????????????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????