Exemplo n.º 1
0
        public static NameValuePairCollection GetQueryParameters(string parameters)
        {
            if (parameters.StartsWith("?"))
            {
                parameters = parameters.Remove(0, 1);
            }

            var result = new NameValuePairCollection();

            if (!string.IsNullOrEmpty(parameters))
            {
                string[] p = parameters.Split('&');
                foreach (string s in p)
                {
                    if (!string.IsNullOrEmpty(s))
                    {
                        if (s.IndexOf('=') > -1)
                        {
                            string[] temp = s.Split('=');
                            result.Add(temp[0], temp[1]);
                        }
                        else
                        {
                            result.Add(s, string.Empty);
                        }
                    }
                }
            }

            return(result);
        }
 public void SetUpFixture()
 {
     tags = new NameValuePairCollection();
     tags.Add(new NameValuePair("Test", "Value"));
     tags.Add(new NameValuePair("DATADIR", "Bitmaps/bin"));
 }