在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
一、字符串[Uri]轉換出RouteData private RouteData UriToRouteData(Uri uri) { var query = uri.Query; if (uri.Query.Length > 0) { query = query.Substring(1, uri.Query.Length - 1); } var request = new HttpRequest("", uri.AbsoluteUri, query); var routeData= Url.RouteCollection.GetRouteData(new HttpContextWrapper(new HttpContext( request, new HttpResponse(null)))); if (request.QueryString.Count > 0 && routeData != null) { foreach (string key in request.QueryString.Keys) { routeData.Values.Add(key, request.QueryString[key]); } } return routeData; } //調用 //RouteData routeData = UriToRouteData(Request.UrlReferrer);
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论