tags:

views:

51

answers:

1

I have a Winform application in which I am checking if a fully qualified file name c:\somefolder\my file name.txt exists in the XML.

Unfortunately, the XML holds the strings html encoded so c:\somefolder\my file name.txt becomes c:/somefolder/my%20file%20name.txt (not the change from backslash to forwardslash, and the %20 instead of blankspace).

How do I HTMLEncode strings in my winform app?

+2  A: 

try

System.Web.HttpUtility.HtmlEncode(foo);

you will need to add a reference to System.Web.dll

Equiso
I had to add a reference. This worked like a charm. Tx.
Raj More