ASP
public class Route : RouteBase
{
public IRouteHandler RouteHandler { get; set; }
public string Url { get; set; }
public IDictionary<string
public Route()
{
this
this
}
public override RouteData GetRouteData(HttpContextBase httpContext)
{
IDictionary<string
if (this
{
RouteData routeData = new RouteData()
foreach (var item in variables)
{
routeData
}
foreach (var item in DataTokens)
{
routeData
}
routeData
return routeData;
}
return null;
}
protected bool Match(string requestUrl
out IDictionary<string
{
variables = new Dictionary<string
string[] strArray
string[] strArray
if (strArray
{
return false;
}
for (int i =
{
if(strArray
{
variables
}
}
return true;
}
}
由於同一個Web應用可以采用多種不同的URL模式
public class RouteTable
{
public static RouteDictionary Routes { get; private set; }
static RouteTable()
{
Routes = new RouteDictionary()
}
}
RouteDictionary表示一個具名的路由對象的列表
public class RouteDictionary: Dictionary<string
{
public RouteData GetRouteData(HttpContextBase httpContext)
{
foreach (var route in this
{
RouteData routerouteData = route
if (null != routeData)
{
return routeData;
}
}
return null;
}
}
返回目錄
編輯推薦
ASP
Microsoft
Java程序性能優化
Visual C++音頻/視頻技術開發與實戰
From:http://tw.wingwit.com/Article/program/net/201311/16111.html