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


C# NameValueCollection.ToQueryString方法代码示例

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


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

示例1: ToQueryString

        /// <summary>
        /// Returns the query string representation of this processor's values
        /// </summary>
        /// <returns></returns>
        public string ToQueryString()
        {
            NameValueCollection parameters = new NameValueCollection();
            parameters.Add("contrast", ContrastPercentage.ToString());

            return parameters.ToQueryString();
        }
开发者ID:kipusoep,项目名称:ImageProcessor.Core,代码行数:11,代码来源:ImageProcessorContrastParameter.cs

示例2: Execute

        private HttpResponseMessage Execute()
        {
            var responseMessage = new HttpResponseMessage(HttpStatusCode.Redirect);
            var url = _response.RedirectUri.AbsoluteUri;
            var query = new NameValueCollection();

            if (_response.IdentityToken.IsPresent())
            {
                query.Add("id_token", _response.IdentityToken);
            }
            
            if (_response.AccessToken.IsPresent())
            {
                query.Add("access_token", _response.AccessToken);
                query.Add("token_type", "Bearer");
                query.Add("expires_in", _response.AccessTokenLifetime.ToString());
            }

            if (_response.Scope.IsPresent())
            {
                query.Add("scope", _response.Scope);
            }

            if (_response.State.IsPresent())
            {
                query.Add("state", _response.State);
            }

            url = string.Format("{0}#{1}", url, query.ToQueryString());
            responseMessage.Headers.Location = new Uri(url);
            
            Logger.Info("Redirecting to " + _response.RedirectUri.AbsoluteUri);
            
            return responseMessage;
        }
开发者ID:kphutt,项目名称:Thinktecture.IdentityServer.v3,代码行数:35,代码来源:AuthorizeImplicitFragmentResult.cs

示例3: ToQueryString

        /// <summary>
        /// Returns the query string representation of this processor's values
        /// </summary>
        /// <returns></returns>
        public string ToQueryString()
        {
            NameValueCollection parameters = new NameValueCollection();
            parameters.Add("alpha", AlphaPercentage.ToString());

            return parameters.ToQueryString();
        }
开发者ID:kipusoep,项目名称:ImageProcessor.Core,代码行数:11,代码来源:ImageProcessorAlphaParameter.cs

示例4: DoRequest

        protected ConnectionStatus DoRequest(string method, string path, object data = null, NameValueCollection queryString = null)
        {
            if (queryString != null)
                path += queryString.ToQueryString();

            var postData = string.Empty;
            var s = data as string;
            if (s != null)
                postData = s;
            else if (data != null)
                postData = this.Serialize(data);

            switch (method.ToLowerInvariant())
            {
                case "post": return this.Connection.PostSync(path, postData);
                case "put": return this.Connection.PutSync(path, postData);
                case "delete":
                    return string.IsNullOrWhiteSpace(postData)
                        ? this.Connection.DeleteSync(path)
                        : this.Connection.DeleteSync(path, postData);
                case "head": return this.Connection.HeadSync(path);
                case "get": return this.Connection.GetSync(path);
            }

            throw new DslException("Unknown HTTP method " + method);
        }
开发者ID:nickcanz,项目名称:NEST,代码行数:26,代码来源:RawElasticClient.cs

示例5: ToQueryString

 public void ToQueryString()
 {
     var Collection = new NameValueCollection();
     Collection.Add("A", "1");
     Collection.Add("B", "2");
     Assert.Equal("?A=1&B=2", Collection.ToQueryString());
 }
开发者ID:modulexcite,项目名称:Craig-s-Utility-Library,代码行数:7,代码来源:NameValueCollectionExtensions.cs

示例6: ToQueryString

        /// <summary>
        /// Returns the query string representation of this processor's values
        /// </summary>
        /// <returns></returns>
        public string ToQueryString()
        {
            NameValueCollection parameters = new NameValueCollection();
            parameters.Add("filter", Filter.ToString().ToLower());

            return parameters.ToQueryString();
        }
开发者ID:kipusoep,项目名称:ImageProcessor.Core,代码行数:11,代码来源:ImageProcessorFilterParameter.cs

示例7: ToQueryString

        /// <summary>
        /// Returns the query string representation of this processor's values
        /// </summary>
        /// <returns></returns>
        public string ToQueryString()
        {
            NameValueCollection parameters = new NameValueCollection();
            parameters.Add("saturation", SaturationPercentage.ToString());

            return parameters.ToQueryString();
        }
开发者ID:kipusoep,项目名称:ImageProcessor.Core,代码行数:11,代码来源:ImageProcessorSaturationParameter.cs

示例8: ToQueryString

        /// <summary>
        /// Returns the query string representation of this processor's values
        /// </summary>
        /// <returns></returns>
        public string ToQueryString()
        {
            NameValueCollection parameters = new NameValueCollection();
            parameters.Add("brightness", BrightnessPercentage.ToString());

            return parameters.ToQueryString();
        }
开发者ID:kipusoep,项目名称:ImageProcessor.Core,代码行数:11,代码来源:ImageProcessorBrightnessParameter.cs

示例9: ToQueryString

        /// <summary>
        /// Returns the query string representation of this processor's values
        /// </summary>
        /// <returns></returns>
        public string ToQueryString()
        {
            NameValueCollection parameters = new NameValueCollection();
            parameters.Add("vignette", true.ToString());

            return parameters.ToQueryString();
        }
开发者ID:kipusoep,项目名称:ImageProcessor.Core,代码行数:11,代码来源:ImageProcessorVignetteParameter.cs

示例10: ToQueryString

        /// <summary>
        /// Returns the query string representation of this processor's values
        /// </summary>
        /// <returns></returns>
        public string ToQueryString()
        {
            NameValueCollection parameters = new NameValueCollection();
            parameters.Add("quality", Quality.ToString());

            return parameters.ToQueryString();
        }
开发者ID:kipusoep,项目名称:ImageProcessor.Core,代码行数:11,代码来源:ImageProcessorQualityParameter.cs

示例11: Post

        public string Post(string requestUrl, string contentType, NameValueCollection collection)
        {
            string postData = collection != null ? collection.ToQueryString() : string.Empty;
            var result = Post(requestUrl, contentType, postData);

            return result;
        }
开发者ID:palebustarde,项目名称:api,代码行数:7,代码来源:GlobeLabsBase.cs

示例12: ToQueryString

        /// <summary>
        /// Returns the query string representation of this processor's values
        /// </summary>
        /// <returns></returns>
        public string ToQueryString()
        {
            NameValueCollection parameters = new NameValueCollection();
            parameters.Add("preset", Preset);

            return parameters.ToQueryString();
        }
开发者ID:kipusoep,项目名称:ImageProcessor.Core,代码行数:11,代码来源:ImageProcessorPresetParameter.cs

示例13: ToQueryStringTest

        public void ToQueryStringTest()
        {
            NameValueCollection nvc = new NameValueCollection();
            nvc["Title"] = "Mr";
            nvc["FirstName"] = "Arthur";
            nvc["Surname"] = "Dent";

            Assert.AreEqual("?Title=Mr&FirstName=Arthur&Surname=Dent", nvc.ToQueryString());
        }
开发者ID:gitter-badger,项目名称:UrlUtilities,代码行数:9,代码来源:ExtensionTests.cs

示例14: ToQueryString_NameValueCollection_Question

        public void ToQueryString_NameValueCollection_Question()
        {
            string expectedResult = "?";
            NameValueCollection nameValueCollection = new NameValueCollection();

            string currentResult = nameValueCollection.ToQueryString();

            Assert.AreEqual(expectedResult, currentResult);
        }
开发者ID:nguyenminhthu,项目名称:TeleConsult,代码行数:9,代码来源:ExtensionTest.cs

示例15: HitEndpoint

		public XmlNode HitEndpoint(string endPoint, string methodName, NameValueCollection querystring)
		{
			if(querystring == null)
				throw new ArgumentException("querystring parameter cannot be null, please instantiate");

			string output = GetEndpointOutput(endPoint, methodName, querystring.ToQueryString() );
			XmlNode response = GetResponseNode(output);
			AssertError(response);
			return response.FirstChild;
		}
开发者ID:tonyto,项目名称:SevenDigital.Api.Wrapper,代码行数:10,代码来源:EndpointResolver.cs


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