AjaxLife.AjaxLife.PostDecode C# (CSharp) Method

PostDecode() public static method

public static PostDecode ( string qstring ) : string>.Dictionary
qstring string
return string>.Dictionary
        public static Dictionary<string, string> PostDecode(string qstring)
        {
            // Make a nice dictionary of data from a standard postdata input.
            qstring = qstring + "&";

            Dictionary<string, string> outc = new Dictionary<string, string>();
            // The splitter.
            Regex r = new Regex(@"(?<name>[^=&]+)=(?<value>[^&]*)&", RegexOptions.IgnoreCase | RegexOptions.Compiled);

            IEnumerator _enum = r.Matches(qstring).GetEnumerator();
            while (_enum.MoveNext() && _enum.Current != null)
            {   // Decode the URLencoding, and add it to the dictionary.
                outc.Add(System.Web.HttpUtility.UrlDecode(((Match)_enum.Current).Result("${name}")),
                            System.Web.HttpUtility.UrlDecode(((Match)_enum.Current).Result("${value}")));
            }

            return outc;
        }