Winform实现抓取web页面内容的方法
作者:shichen2014 时间:2022-03-07 21:15:53
本文以一个非常简单的实例讲述了Winform实现抓取web页面内容的方法,代码简洁易懂,非常实用!分享给大家供大家参考。
具体实现代码如下:
WebRequest request = WebRequest.Create("http://1.bjapp.sinaapp.com/play.php?a=" + PageUrl);
WebResponse response = request.GetResponse();
Stream resStream = response.GetResponseStream();
StreamReader sr = new StreamReader(resStream, System.Text.Encoding.UTF8);
string htmlinfo = sr.ReadToEnd();
resStream.Close();
sr.Close();
感兴趣的朋友可以测试运行或改进本文实例。希望本文所述对大家C#程序设计的学习有所帮助。
标签:Winform,抓取,web页面,内容
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
Android 在程序运行时申请权限的实例讲解
2023-08-04 17:35:57
![](https://img.aspxhome.com/file/2023/7/85997_0s.jpg)
Spring bean为什么需要依赖注入
2022-01-24 11:07:21
![](https://img.aspxhome.com/file/2023/6/66186_0s.png)
Flutter加载图片流程MultiFrameImageStreamCompleter解析
2023-07-19 02:45:55
SpringBoot异常处理器的使用与添加员工功能实现流程介绍
2021-10-21 19:24:23
![](https://img.aspxhome.com/file/2023/8/60908_0s.png)
Java 关于String字符串原理上的问题
2021-05-26 12:48:44
两天没解决的问题chatgpt用了5秒搞定隐藏bug
2023-11-18 22:54:08
![](https://img.aspxhome.com/file/2023/5/59245_0s.jpg)
java编程多线程并发处理实例解析
2022-06-02 22:14:59
Java语言描述MD5加密工具类实例代码
2021-09-18 07:07:34
Java中避免NullPointerException的方法总结
2021-08-29 08:09:24
springboot大文件上传、分片上传、断点续传、秒传的实现
2023-06-16 02:18:30
springboot 项目启动后无日志输出直接结束的解决
2023-05-25 02:28:21
![](https://img.aspxhome.com/file/2023/0/66240_0s.gif)
MyBatis-Plus实现分页的方法使用详解
2023-02-14 18:22:16
![](https://img.aspxhome.com/file/2023/6/60026_0s.png)
idea搭建SSM框架遇踩的坑(附完整过程)
2023-06-23 09:53:07
![](https://img.aspxhome.com/file/2023/6/66506_0s.png)
java编程小白进阶包的作用详解
2022-01-22 05:15:24
![](https://img.aspxhome.com/file/2023/5/70915_0s.png)
C#可用于登录验证码的四位随机数生成方法
2021-08-01 00:31:01
Java安全-ClassLoader
2023-08-18 02:12:21
![](https://img.aspxhome.com/file/2023/9/80329_0s.png)
C#中判断、验证字符串是否为日期格式的实现代码
2021-06-05 01:57:26
java转树形结构工具类详解
2021-07-26 04:00:08
java运行windows的cmd命令简单代码
2021-06-12 11:50:47
![](https://img.aspxhome.com/file/2023/6/85836_0s.png)
Quarkus中ConfigSourceInterceptor的加密配置实现
2021-10-08 10:47:14