Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/258.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/assembly/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 阅读Html代码并查找文本。C_C# - Fatal编程技术网

C# 阅读Html代码并查找文本。C

C# 阅读Html代码并查找文本。C,c#,C#,我正在使用此代码阅读html页面: WebClient client = new WebClient(); String htmlCode = client.DownloadString(@"C:\checkemails\check.html"); // Replace all html breaks for line seperators. htmlCode = htmlCode.Replace("<br>"

我正在使用此代码阅读html页面:

 WebClient client = new WebClient();
            String htmlCode = client.DownloadString(@"C:\checkemails\check.html");
            // Replace all html breaks for line seperators.
            htmlCode = htmlCode.Replace("<br>", "\r\n");
            MessageBox.Show(htmlCode);
html页面位于C:\上,但假设我正在加载yahoo.com。。或者任何一页

我要找一个姓的,身份是

<div id ="say">
我该怎么做呢?

试着用它来做这类事情

有关从div中选择项的信息,请参见示例

尝试将其用于此类事情


有关从div中选择项的信息,请参见示例

我需要它做什么?它是一个库-您可以从codeplex下载它,它附带示例。。。只需按照我答案中的第一个链接。愚蠢的问题。我从来没有用过图书馆,我该把它放在哪里呢!它的作品。你给我的另一个东西不是很好,任何人都有其他的吗?把它放在你想放的任何地方-唯一重要的是能够在你的项目中添加引用HamlAgilityPack.dll,也可以将copy local设置为true,然后在你的源代码中使用HtmlAgilityPack添加;我需要它做什么?它是一个库-你可以从codeplex下载它,它附带了一些示例。。。只需按照我答案中的第一个链接。愚蠢的问题。我从来没有用过图书馆,我该把它放在哪里呢!它的作品。你给我的另一个东西不是很好,任何人都有其他的吗?把它放在你想放的任何地方-唯一重要的是能够在你的项目中添加引用HamlAgilityPack.dll,也可以将copy local设置为true,然后在你的源代码中使用HtmlAgilityPack添加;