tags:

views:

3180

answers:

4

I know there are different methods in the System.Web namespace for decoding html entities (such as "%20" for space). I'm building a Winforms application however, but needs to deal with html encoded strings. Basically I have the iTunes Library XML file and need to decode the URLs in there to check the files.

Is this possible without the System.Web namespace?

+6  A: 

Just because you're writing a Windows Forms app doesn't stop you from using System.Web. Just add a reference to System.Web.dll.

Jon Skeet
I have tripped on this before. I forgot the reference, thought a "using" would do. Thanks!
miccet
The issue with that is that you can't use the .NET 3.5 Client profile with your .NET app so your XP users can avoid the 150mb download and go for the smaller 28mb one. Best to avoid the System.Web namespace if you can.
Zac Bowling
+2  A: 

To use the methods that are in the .NET framework you must use the System.Web namespace to get the HtmlDecode method.

Yes, you could write your own method to do it, but that wouldn't make a lot of sense.

Just add the reference to system.web.

Mitchel Sellers
+3  A: 
Steve Eisner
Thanks Steve, this was exactly what I was looking for +1
Si
+2  A: 

You can use HttpUtility.UrlDecode or HttpUtility.HtmlDecode

pathachiever11