Replace item in querystring
问题 I have a URL that also might have a query string part, the query string might be empty or have multiple items. I want to replace one of the items in the query string or add it if the item doesn't already exists. I have an URI object with the complete URL. My first idea was to use regex and some string magic, that should do it. But it seems a bit shaky, perhaps the framework has some query string builder class? 回答1: Maybe you could use the System.UriBuilder class. It has a Query property. 回答2: