I have set of URL's similar to the ones below in a list
I have managed to get the query strings using the following code:
myurl = longurl.Split('?');
NameValueCollection qs = HttpUtility.ParseQueryString(myurl [1]);
foreach (string lol in qs)
{
// results will return
}
But it only returns the parameters like
id, server, location and so on based on the URL provided.
What I need is to add / append values to the existing query strings.
For example with the URL:
http://somesite.com/backup/index.php?action=login&attempts=1
I need to alter the values of the query string parameters:
action=login1
attempts=11
As you can see, I have appended "1" for each value. I need to get a set of URL's from a string with different query strings in them and add a value to each parameter at the end & again add them to a list.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…