當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。