C#将HtmlString转换为HTMLDocument [英] C# Convert HtmlString into HTMLDocument

查看:1198
本文介绍了C#将HtmlString转换为HTMLDocument的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有HTML文件模板,我需要将其读入HTMLDocument对象以修改HTML正文。

I have the HTML file Template which i need to read into HTMLDocument Object to modify the HTML Body.

我无法将HTMLString内容加载到HTMLDocument中。

I am unable to Load the HTMLString content into the HTMLDocument. any point with sample C# code would very helpful.

在此先感谢您的答复。

推荐答案

我认为此StackOverflow讨论将为您提供帮助。
您可以找到两种方法来解决问题:

I think this StackOverflow discussion will help you. You can find two ways to solve your problem:

  HTMLDocument doc = new HTMLDocument();
  IHTMLDocument2 doc2 = (IHTMLDocument2)doc;    

  doc2.write(fileText);

这篇关于C#将HtmlString转换为HTMLDocument的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆