Get the string found after the question mark, divide the string by the '&' character. Then, for each returned string, separate the "=" character again.
You can even create an extension method for it.
public static class StringExtensions
{
public Dictionary<string, string> ExtractQueryStringValues( this string target )
{
string queryString = target.Split (target.IndexOf ('?') + 1);
string[] keyvaluePairs = queryString.Split ('&');
Dictionary<string, string> result = new Dictionary<string, string>();
foreach( string pair in keyvaluePairs )
{
var tmp = pair.Split ('=');
result.Add (tmp[0], tmp[1]);
}
return result;
}
}
- .
, , . (, , ..), .