How to get query string from a URL in C#

Waqas Anwar
22 August 2014

Following code snippet shows you how to get query string from a url using c#.

string urlString = "";
Uri uri = new Uri(urlString);
string queryString = uri.Query;

If you want to get the value of individual query string parameter then you can use following code snippet.

string technology = System.Web.HttpUtility.ParseQueryString(queryString).Get("technology");