惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Cyberwarzone
Cyberwarzone
V
Vulnerabilities – Threatpost
T
Tenable Blog
Forbes - Security
Forbes - Security
Simon Willison's Weblog
Simon Willison's Weblog
AWS News Blog
AWS News Blog
G
GRAHAM CLULEY
Know Your Adversary
Know Your Adversary
S
Securelist
C
Cybersecurity and Infrastructure Security Agency CISA
Project Zero
Project Zero
C
CXSECURITY Database RSS Feed - CXSecurity.com
V
Visual Studio Blog
WordPress大学
WordPress大学
Latest news
Latest news
K
Kaspersky official blog
T
Tailwind CSS Blog
T
Threat Research - Cisco Blogs
B
Blog RSS Feed
C
Cisco Blogs
博客园 - 聂微东
Martin Fowler
Martin Fowler
T
The Blog of Author Tim Ferriss
小众软件
小众软件
L
LangChain Blog
阮一峰的网络日志
阮一峰的网络日志
L
LINUX DO - 热门话题
Stack Overflow Blog
Stack Overflow Blog
罗磊的独立博客
P
Proofpoint News Feed
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
P
Privacy International News Feed
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
C
CERT Recently Published Vulnerability Notes
Cisco Talos Blog
Cisco Talos Blog
S
SegmentFault 最新的问题
Security Latest
Security Latest
Y
Y Combinator Blog
爱范儿
爱范儿
aimingoo的专栏
aimingoo的专栏
P
Privacy & Cybersecurity Law Blog
L
LINUX DO - 最新话题
月光博客
月光博客
The GitHub Blog
The GitHub Blog
博客园 - 三生石上(FineUI控件)
S
Security Affairs
P
Proofpoint News Feed
D
DataBreaches.Net
有赞技术团队
有赞技术团队
云风的 BLOG
云风的 BLOG

博客园 - 逍遥游

验证数字的正则表达式集 .NET实现RSS格式文件 - 逍遥游 - 博客园 SQL SERVER 2005 通过链接服务器 访问 ORACLE 9i 的快速设定方法 [转]asp.net页面缓存技术 - 逍遥游 - 博客园 Oracle常用Script [整理]如何在 JavaScript 中实现拖放 [转]鼠标拖动层的javascript脚本 [转]Spring笔记 [转]web项目经理手册-项目经理需要铭记在心的话 [原]学习Struts+Spring+hibernate笔记 [转]Request.UrlReferrer详解 [转]hibernate产生自动增长的主键 JSP学习相关链接 C#中如何动态运行代码 .net 资源网站收集 一个很COOL的图片验证码程序[含源码] 转 关于XMLHTTP无刷新数据获取和发送 (转) 使用Hibernate、Struts的一些错误总结 [转]简单好用的ajax进度条(xmlhttp),实现的是真正的进度
.NET中获取客户端HTML代码
逍遥游 · 2007-06-06 · via 博客园 - 逍遥游

///   <summary> 
  ///   传入URL返回网页的html代码 
  ///   </summary> 
  ///   <param   name="Url">URL</param> 
  ///   <returns></returns> 
  public   static     string   getUrltoHtml(string   Url) 
  { 
  errorMsg   =   ""; 
  try 
  { 
  System.Net.WebRequest   wReq   =   System.Net.WebRequest.Create(Url); 
  //   Get   the   response   instance. 
  System.Net.WebResponse   wResp   =wReq.GetResponse(); 
  //   Read   an   HTTP-specific   property  
  //   Get   the   response   stream. 
  System.IO.Stream   respStream     =   wResp.GetResponseStream(); 
  //   Dim   reader   As   StreamReader   =   New   StreamReader(respStream) 
  System.IO.StreamReader   reader   =   new   System.IO.StreamReader(respStream,   System.Text.Encoding.GetEncoding("gb2312")); 
  return     reader.ReadToEnd(); 
  
  } 
  catch(System.Exception   ex) 
  { 

Chinaz.com

  errorMsg   =   ex.Message   ; 
  } 
  return   ""; 
  } 
  
  你可以用这个函数获取网页的客户端的html代码,然后保存到.html文件里就可以了。