private static Dictionary<string, string> ParseToDictionary(string str) { Dictionary<string, string> result = new Dictionary<string, string>(); var pairs = str.Split(‘&‘); foreach (var p in pairs) { var items = p.Split(‘=‘); if (items.Length == 2) { result.Add(items[0], items[1]); } else continue; } return result; }