Httputility.urldecode replacement in .Net4?

Rev picture Rev · Aug 4, 2011 · Viewed 11k times · Source

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?

Answer

Elazaron picture Elazaron · Dec 1, 2013

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