简体   繁体   中英

How to generate HTML from a winform (c#) application

I need to create a log file containing HTML (tables, etc). It seems that HtmlTextWriter is not supported in plain winforms applications, it is intended for ASP.NET. Is this in fact the case, and if so, what classes are available to generate HTML? I was trying to use FileStream/StreamWriter but it chokes on "illegal characters".

HtmlTextWriter is available to WinForms apps, just not by default. You have to add a reference to System.Web in the WinForms project to be able to use it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM