How to get rid of HTML-tags in a message?

穿精又带淫゛_ 提交于 2020-01-07 04:09:48

问题


For the last time I've been using EWS MAPI to connect to Exchange Server. After this is done I access my mails and firstly display their body (which contains a LOT HTML-tags) in a gridview. After you select a record of that gridview the body is shown in a freetextbox.

My problem is that I want to get rid of the HTML in the body. And configure the freetextbox so that it still displays the the text in his true format.

Thanks in advance.


回答1:


You can use regular expressions.

have a look at: here




回答2:


You can use Html Agility Pack to parse Html and strip out what you want. There are a lot of information on SO about it, for example: How to use HTML Agility pack




回答3:


Maybe this can help

Convert special chars to HTML entities, without changing tags and parameters



来源:https://stackoverflow.com/questions/5229700/how-to-get-rid-of-html-tags-in-a-message

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!