当前位置: 首页>>代码示例>>C#>>正文


C# Url.GetQueries方法代码示例

本文整理汇总了C#中N2.Web.Url.GetQueries方法的典型用法代码示例。如果您正苦于以下问题:C# Url.GetQueries方法的具体用法?C# Url.GetQueries怎么用?C# Url.GetQueries使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在N2.Web.Url的用法示例。


在下文中一共展示了Url.GetQueries方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: FakeHttpContext

		public FakeHttpContext(Url url)
			: this()
		{
			request.appRelativeCurrentExecutionFilePath = "~" + url.Path;
			foreach (var q in url.GetQueries())
				request.query[q.Key] = q.Value;
			request.rawUrl = url.PathAndQuery;
		}
开发者ID:grbbod,项目名称:drconnect-jungo,代码行数:8,代码来源:FakeHttpContext.cs

示例2: FakeHttpContext

        public FakeHttpContext(Url url)
            : this()
        {
            request.appRelativeCurrentExecutionFilePath = "~" + url.Path;
            foreach (var q in url.GetQueries())
                request.query[q.Key] = q.Value;
            request.rawUrl = url.PathAndQuery;
			if (url.Path.IndexOf(".ashx/") > 0)
				request.pathInfo = url.Path.Substring(url.Path.IndexOf(".ashx/") + 5);
        }
开发者ID:rukmareddy,项目名称:n2cms,代码行数:10,代码来源:FakeHttpContext.cs

示例3: CanGet_EmptyQueryDictionary

 public void CanGet_EmptyQueryDictionary()
 {
     Url u = new Url("/hello.aspx");
     var q = u.GetQueries();
     Assert.That(q.Count, Is.EqualTo(0));
 }
开发者ID:rohancragg,项目名称:n2cms,代码行数:6,代码来源:UrlTests.cs

示例4: CanGet_QueryDictionary

 public void CanGet_QueryDictionary()
 {
     Url u = new Url("/hello.aspx?something=someotherthing");
     var q = u.GetQueries();
     Assert.That(q.Count, Is.EqualTo(1));
     Assert.That(q["something"], Is.EqualTo("someotherthing"));
 }
开发者ID:rohancragg,项目名称:n2cms,代码行数:7,代码来源:UrlTests.cs

示例5: RequestingUrl

        protected RouteData RequestingUrl(Url url)
        {
            httpContext.request.appRelativeCurrentExecutionFilePath = "~" + url.Path;
            httpContext.request.rawUrl = url;

            NameValueCollection nvc = new NameValueCollection();
            foreach (var kvp in url.GetQueries())
                nvc[kvp.Key] = kvp.Value;
            httpContext.request.query = nvc;

            foreach (var kvp in url.GetQueries())
                httpContext.request.query[kvp.Key] = kvp.Value;

            var data = route.GetRouteData(httpContext);
            requestContext = new RequestContext(httpContext, data);
            urlHelper = new UrlHelper(requestContext, routes);
            htmlHelper = new HtmlHelper(new ViewContext { RequestContext = requestContext, HttpContext = httpContext, RouteData = requestContext.RouteData, Writer = httpContext.Response.Output }, new ViewPage(), routes);
            return data;
        }
开发者ID:AnonymousRetard,项目名称:n2cms,代码行数:19,代码来源:ContentRouteTests.cs


注:本文中的N2.Web.Url.GetQueries方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。