如何阅读HTML文件以及如何在C#中找到所需的字符串? [英] How to read HTML file and to how to find desired string in C#?

查看:232
本文介绍了如何阅读HTML文件以及如何在C#中找到所需的字符串?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,



我想创建一个可以读取html文件的应用程序。然后我想搜索所需的字符串并使用C#将数据转换为文本编辑元素。你能帮忙解决任何例子或教程吗?谢谢!



问候



我的尝试:



WebClient客户端=新的WebClient();

字符串htmlCode = client.DownloadString(D:/ Work 2017 / Site.html);

Hello,

I would like to create an application that could read an html file. Then I would like to search desired strings and get the data to text edit elements using C#. Could you please help with any example or tutorial? Thank you!

Regards

What I have tried:

WebClient client = new WebClient();
String htmlCode = client.DownloadString("D:/Work 2017/Site.html");

推荐答案

这里有一些关于解析HTML文档的方法的讨论,以帮助您入门:



HTML文档字符串 [ ^ ]
There is some discussion of various methods to parse HTML documents here to get you started:

String to HTML Document[^]


这篇关于如何阅读HTML文件以及如何在C#中找到所需的字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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