In one of my programs I have to process an encrypted Url. I want to save the parameter to a string and I want to keep the special characters as they are
string input_url ="domain.com/auth?token=%2FhKjSuSAO6ctIrgokvB9hmHJPlHQXqTmpuH9fEPWp8w";
I want to process the token query string in a decoded form I tried the code
string input_url ="domain.com/auth?token=%2FhKjSuSAO6ctIrgokvB9hmHJPlHQXqTmpuH9fEPWp8w";
val = System.Net.WebUtility.HtmlDecode(input_url.ToString());
val2 = val.Split('=')[1];
But I get the value as %2FhKjSuSAO6ctIrgokvB9hmHJPlHQXqTmpuH9fEPWp8w
What i want is val=/hKjSuSAO6ctIrgokvB9hmHJPlHQXqTmpuH9fEPWp8w
(keep %2F
as /
, like for other special characters if any exists)
How can I do this?
System.Net.WebUtility.UrlDecode works with .Net 4 Client profiles only string value_string = Uri.UnescapeDataString(e.Url.Query); wil work for .net 4 applications