Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/image-processing/2.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#_Asp.net_Web Applications_Parser Generator - Fatal编程技术网

C# 如何以编程方式解析HTML文件和提交信息

C# 如何以编程方式解析HTML文件和提交信息,c#,asp.net,web-applications,parser-generator,C#,Asp.net,Web Applications,Parser Generator,ASP.NET 4&C#和 我想知道哪些代码、类对于创建能够: 01 - Connect to an HTML file on the web. 02 - Parse its content (text content). 03 - Find out specific content in a page (for example looking for specific keywords). 以及如何实施: 04 - How to submit information programmatic

ASP.NET 4&C#和

我想知道哪些代码、类对于创建能够:

01 - Connect to an HTML file on the web.
02 - Parse its content (text content).
03 - Find out specific content in a page (for example looking for specific keywords).
以及如何实施:

04 - How to submit information programmatically in HTML page (feeling forms).
我对理解完成这项任务的类、一般实践和代码很感兴趣

如果你有任何想法,请告诉我。再次感谢大家的支持!:-)

使用调用对web页面的请求

然后可以解析HTML响应

要以编程方式提交表单,我认为您需要在客户端(JavaScript)执行此操作:


我不确定您是否希望您提到的所有内容都执行“服务器端”,但假设是这样的:

01-连接到计算机上的HTML文件 网络

查看该类,并查看该类以了解更高级的场景

02-解析其内容(文本内容)。 03-在表格中查找具体内容 页面(例如,查找特定的 关键词)

您可能需要查看,或者如果Bobince没有注意到

04-如何提交信息 在HTML页面中以编程方式(感觉) 表格)


通常,这需要发送请求,这也可以通过
HttpWebRequest
类来完成。

要解析网页,请查看
对于表单传递,您需要使用Firebug或Internet Explorer开发工具等工具,或者使用Wireshark等嗅探器查看通过网络发送的内容。

我也会考虑在你的情况下考虑把它拆分成分离的组件,这样你就可以很容易地测试部分过程。

@吉博克:抱歉没有提供上下文,这只是一个笑话。
document.forms[0].submit();