简体   繁体   English

如何从Winform(C#)应用程序生成HTML

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

I need to create a log file containing HTML (tables, etc). 我需要创建一个包含HTML(表等)的日志文件。 It seems that HtmlTextWriter is not supported in plain winforms applications, it is intended for ASP.NET. 普通的Winforms应用程序似乎不支持HtmlTextWriter,它适用于ASP.NET。 Is this in fact the case, and if so, what classes are available to generate HTML? 实际上是这样吗?如果是这样,哪些类可用于生成HTML? I was trying to use FileStream/StreamWriter but it chokes on "illegal characters". 我试图使用FileStream / StreamWriter,但是它在“非法字符”上令人窒息。

HtmlTextWriter is available to WinForms apps, just not by default. HtmlTextWriter可用于WinForms应用程序,但默认情况下不可用。 You have to add a reference to System.Web in the WinForms project to be able to use it. 您必须在WinForms项目中添加对System.Web的引用才能使用它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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