I have some problems with the UriBuilder and Uri tutorials in .NET. I want to build Uri with UriBuilder and then use the resulting Uri. However, I canโt get him to correctly encode the plus sign in his query string?
Here is an example of a little code:
var ub = new UriBuilder(); ub.Query = "t=a%2bc"; Console.WriteLine(ub.Uri.ToString());
This example gives me http://localhost/?t=a+c , but I would expect the plus sign to be encoded in% 2b, like this, http://localhost/?t=a%2bc , otherwise I will not I can use url.
I could, of course, create a string instead, but I would rather use a strongly typed Uri, if possible.
viblo Feb 27 '13 at 17:21 2013-02-27 17:21
source share