使用C#类获取HTML页面内容 [英] Get html page content with c# class

查看:421
本文介绍了使用C#类获取HTML页面内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我想知道什么是获取HTML页面内部内容的最佳方法吗?
我正在使用c#类,并且想通过电子邮件发送页面内容.
我不得不提到html文件位于项目的目录中,因此我不想从其他服务器下载它.

谢谢,谢谢.
Ben

Hi,
I want to know what''s the best way to get the inner content of an html page?
I''m using a c# class and I want to send the page''s content as an email.
I have to mention that the html file is placed in the project''s directory, so I don''t want to download it form another server.

Thanks, from advance,
Ben

推荐答案

我建​​议使用HTML agility pack,因为它可以容忍xml或html页面中的语法错误:
http://htmlagilitypack.codeplex.com/ [ ^ ]

它还可以保存您可能应用于HTML页面的更改.

希望对您有所帮助.
I suggest HTML agility pack because it tolerates syntax errors in xml or html pages :
http://htmlagilitypack.codeplex.com/[^]

Also it can save the changes you may apply to a HTML page.

Hope it helps.


通过此链接

这可能会帮助您此处 [ ^ ]
go through this link

this may helps you Here[^]


这篇关于使用C#类获取HTML页面内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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