public static string ToQueryString(this HttpValueCollection nvc, bool includePrefix = true)
 {
     string[] array = (from kvp in nvc
                       select string.Format("{0}={1}", Uri.EscapeUriString(kvp.Key), Uri.EscapeUriString(kvp.Value)))
                      .ToArray();
     return((includePrefix ? "?" : "") + string.Join("&", array));
 }
Esempio n. 2
0
        public void AddParameter(string key, string value)
        {
            if (value == null)
            {
                return;
            }
            if (Query == null)
            {
                Query = new HttpValueCollection();
            }

            Query.Add(key, value);
        }