I've found that it can be done with the HttpUtility.ParseQueryString method
class, but namespace System.Web
that contains it is not available for WinRT, according to the documentation it's recommend to use the classes from Windows.Web.Http
to perform HTTP tasks on Windows Runtime projects, there is anything within this namespace that allows to extract query parameters from a URI as a collection? I tried to look for something within it, but I couldn't find anything that could be used for that.
Thanks in advance.
Note that System.Web
namespace is not available on WinRT.
Uri baseUri = new Uri ("http://www.contoso.com/");
Uri myUri = new Uri (baseUri, "catalog/shownew.htm?date=today");
Console.WriteLine (myUri.Query);
returns ?date=today
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.