本文整理匯總了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;
}
示例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;
}
示例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;
}
}