C# – Httputility.urldecode replacement in .Net4

.net-2.0.net-4.0cencodingsystem.web

I got an old Program(class library) developed by .Net 2. Recently I want to use that Program in new project which is use .Net4(For new WPF feature's ). so there is a big problem:

.Net4 don't support System.Web and as result it can't be use Httputility.urldecode!!

So what is urldecode jop? and how can I change that to something, which is support by .Net4?

Best Answer

HttpUtility is wild goose chase for c# users since it's not already there (referenced)
2 alternatives :

  string a =  System.Uri.EscapeUriString("https://some.url.goes.here"); // for path
  string b = System.Uri.EscapeDataString("parameter1=1&parameter2=something"); // for params
Related Topic