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


C# UriBuilder.EditQueryArgument方法代码示例

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


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

示例1: UpdateEtag

        public bool UpdateEtag(HttpResponseBase response, Uri uri, string etag)
        {
            var newLocation = new UriBuilder(uri);
            newLocation.EditQueryArgument(UrlEtagQuerystringName, etag);
            HttpResponseHeaderHelper.SetContentLocation(response, newLocation.Uri);

            return false;
        }
开发者ID:atifaziz,项目名称:talifun-web,代码行数:8,代码来源:UrlEtagHandlerContentLocation.cs

示例2: UpdateEtag

        public bool UpdateEtag(HttpResponseBase response, Uri uri, string etag)
        {
            var newLocation = new UriBuilder(uri);
            newLocation.EditQueryArgument(UrlEtagQuerystringName, etag);
            HttpResponseHeaderHelper.SetTemporaryRedirect(response, newLocation.Uri);

            return true;
        }
开发者ID:atifaziz,项目名称:talifun-web,代码行数:8,代码来源:UrlEtagHandlerTemporaryRedirect.cs

示例3: GetUrlEtagHandler

        /// <summary>
        /// The url etag handler to use.
        /// </summary>
        /// <param name="request">An HTTP request.</param>
        /// <param name="response">An HTTP response.</param>
        /// <param name="urlEtagHandlingMethod">The url etag handler method to use.</param>
        /// <param name="urlEtagQuerystringName">The querystring parameter name that contains the url etag.</param>
        /// <param name="etag">The etag the url etag should match.</param>
        /// <returns></returns>
        protected IUrlEtagHandler GetUrlEtagHandler(HttpRequestBase request, HttpResponseBase response, UrlEtagHandlingMethodType urlEtagHandlingMethod, string urlEtagQuerystringName, string etag)
        {
            if (urlEtagHandlingMethod == UrlEtagHandlingMethodType.None || !HttpRequestHeaderHelper.HasQuerystringParameter(request, urlEtagQuerystringName))
            {
                return null;
            }

            var urlEtag = HttpRequestHeaderHelper.GetQuerystringParameterValue(request, urlEtagQuerystringName);
            if (urlEtag == etag)
            {
                return null;
            }
            var newLocation = new UriBuilder(request.Url);
            newLocation.EditQueryArgument(urlEtagQuerystringName, etag);

            switch (urlEtagHandlingMethod)
            {
                case UrlEtagHandlingMethodType.ContentLocation:
                    return new UrlEtagHandlerContentLocation(HttpResponseHeaderHelper, urlEtagQuerystringName);
                case UrlEtagHandlingMethodType.MovedPermanently:
                    return new UrlEtagHandlerMovedPermanently(HttpResponseHeaderHelper, urlEtagQuerystringName);
                case UrlEtagHandlingMethodType.TemporaryRedirect:
                    return new UrlEtagHandlerTemporaryRedirect(HttpResponseHeaderHelper, urlEtagQuerystringName);
                default:
                    return null;
            }
        }
开发者ID:abedon,项目名称:talifun-web,代码行数:36,代码来源:HttpRequestResponder.cs


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