我们如何使用ASP.NET,C#在后面的代码中解析html标签 [英] How can we parse html tags using ASP.NET, C# in code behind

查看:96
本文介绍了我们如何使用ASP.NET,C#在后面的代码中解析html标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我有问题.
Actulay一些带有html标记的字符串块(例如< b>< UL< Li>< a>)存储在Database SQL Server中,我只想从databse中读取该字符串块并希望对其进行解析在后面的代码中,之后我想在pdf中编写已解析的html.

我已经完成工作了.
从数据库中获取数据并以.pdf格式写入.
但这是用html标签编写字符串.
我只想解析html标签(代替必须是Symbol的< UL< LI>),然后用解析的符号将其写入Pdf.我也想解析pdf中的锚标签,以便它可以点击..


请帮我...解决方案..C#asp.net

提前thnxx ..
Dinesh Chauhan
软件工程师
Wipro Ltd.

Hi,
I have a problem.
Actulay Some block of strings with html tags(Like <b> <UL> <Li> <a>) is stored in Database SQL Server.I just want to read that block of strings from databse and want to parse it in code behind and after that i want to write parsed html in a pdf.

I have completed work..
Fetched the data from the database and written it in .pdf format.
But it is writing string with html tags.
I just want to parse html tags(in place of <UL><LI> it must be Symbol) and after that with parsed symbols i wanr to write it in Pdf.I also want to parsed anchor tag in pdf so that it be clickable..


Plz Help me...solution..in C# asp.net

thnxx in advance..
Dinesh Chauhan
Software Engineer
Wipro Ltd.

推荐答案

您要HTML到PDF转换器吗?

这并不简单,但这听起来像是一个普遍的要求-您尝试过Google吗?
You want an HTML to PDF converter?

This is not trivial, but it sounds like a common requirement - have you tried Google?


您可以拥有 HTML敏捷包 [ ^ ]将帮助您解析更复杂的HTML方式.

如果有帮助,请 投票 接受答案 .
You can have HTML Agility pack[^] Will help you to parse HTML in more sophisticated manner.

Please vote and Accept Answer if it Helped.


这篇关于我们如何使用ASP.NET,C#在后面的代码中解析html标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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