Query Strings : Query String « Network « C# / C Sharp






Query Strings

   
using System;
using System.Collections;

public static class HTTPUtility
{
    #region Query Strings

    public static string ParameterListToQueryString(IList parameters)
    {
        if (parameters == null)
            return null;

        string result = string.Empty;

        for (int i = 0; i < parameters.Count; i++)
        {
            QueryParameter p = (QueryParameter)parameters[i];
            result += UrlEncode(p.Key) + '=' + UrlEncode(p.Value);
            if (i < parameters.Count - 1)
                result += '&';
        }

        return result;
    }

    #endregion

}

   
    
    
  








Related examples in the same category

1.Convert to Query String from IDictionary
2.Dictionary To Query String
3.Build Query String