Best way to HtmlEncode, desktop app. not ASP.NET

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm creating a simple utility that generates some XHTML.

It does this from data submitted in a spreadsheet.

It's a desktop application (WinForms).

I've used Server.htmlencode and httputility... in other contexts. What is
the simplest way to get this functionality in this case?
 
I'm creating a simple utility that generates some XHTML.

It does this from data submitted in a spreadsheet.

It's a desktop application (WinForms).

I've used Server.htmlencode and httputility... in other contexts. What is
the simplest way to get this functionality in this case?

Reference/Import the System.Web dll and use the HtmlUtility.HtmlEncode
functionality - it's safe to use this classes in either a web or
windows application.

Thanks,

Seth Rowe
 
Thanks.

I recall some convoluted approach from the past, probably .NET 1.0 days.

I have two approaches in there now. One uses the ...Utility, the other has
code based on the framework. (I saw a reference to HtmlEncode not handling
Euro's so I added that. It will also give me the opportunity to add named as
opposed to numeric entities should I wish to go down that road. (It's more
readable to the developer!))
 
Back
Top