ASP.NET实现HTTP方式获取功能
来源:互联网 发布:帝国cms 系统模型 编辑:程序博客网 时间:2024/06/06 08:55
<%@ Assembly Name="System.Net" %>
<%@ Import Namespace="System.Net" %>
<%@ Import Namespace="System.IO" %>
<script language="VB" runat="server">
dim STRtemp as string
Sub Page_Load(Src As Object, E As EventArgs)
Dim HttpWResp as HTTPWebresponse
Dim sr As StreamReader
'dim STRtemp as string
dim build as new stringbuilder
HttpWReq = WebRequestFactory.Create("http://www.funinspace.com")
HttpWReq.KeepAlive = false
HttpWResp = HttpWReq.GetResponse()
sr = new StreamReader(HttpWResp.GetResponseStream(), Encoding.ASCII)
Try
line=sr.ReadLine()
lineENC = server.HTMLencode(line) & vbcrlf & "<br>"
build.append (lineENC)
do while not IsNothing(line)
line = sr.ReadLine()
lineENC = server.HTMLencode(line) & vbcrlf & "<br>"
build.append (lineENC)
loop
Catch ex As Exception
problem.text =ex.Message
End Try
labelscrape.text=build.ToString()
End Sub
</script>
<html><head>
<title>Scraping A Website</title>
</head>
<body bgcolor="#FFFFFF">
<h3><font face="Verdana">Scraped Data</font></h3>
<asp:label id=problem runat="server"/>
<font face="courier new" size="2">
<asp:label id=labelscrape runat="server"/>
</font>
</body></html>
<%@ Import Namespace="System.Net" %>
<%@ Import Namespace="System.IO" %>
<script language="VB" runat="server">
dim STRtemp as string
Sub Page_Load(Src As Object, E As EventArgs)
Dim HttpWResp as HTTPWebresponse
Dim sr As StreamReader
'dim STRtemp as string
dim build as new stringbuilder
HttpWReq = WebRequestFactory.Create("http://www.funinspace.com")
HttpWReq.KeepAlive = false
HttpWResp = HttpWReq.GetResponse()
sr = new StreamReader(HttpWResp.GetResponseStream(), Encoding.ASCII)
Try
line=sr.ReadLine()
lineENC = server.HTMLencode(line) & vbcrlf & "<br>"
build.append (lineENC)
do while not IsNothing(line)
line = sr.ReadLine()
lineENC = server.HTMLencode(line) & vbcrlf & "<br>"
build.append (lineENC)
loop
Catch ex As Exception
problem.text =ex.Message
End Try
labelscrape.text=build.ToString()
End Sub
</script>
<html><head>
<title>Scraping A Website</title>
</head>
<body bgcolor="#FFFFFF">
<h3><font face="Verdana">Scraped Data</font></h3>
<asp:label id=problem runat="server"/>
<font face="courier new" size="2">
<asp:label id=labelscrape runat="server"/>
</font>
</body></html>
- ASP.NET实现HTTP方式获取功能
- ASP.NET实现HTTP方式获取功能
- ASP.NET实现HTTP方式获取功能
- ASP.NET MVC使用中转站方式获取code实现微信登录,分享功能
- asp.net实现pop功能
- asp.net实现pop功能
- asp.net实现pop功能
- asp.net实现pop功能
- asp.net实现下载功能
- ASP.NET手机短信功能实现
- <asp.net> 实现返回功能
- asp.net实现pop功能
- asp.net实现编辑器功能
- AjaxPro.NET实现TextBox智能获取服务端数据功能(Asp.net 2.0)(示例代码下载)
- AjaxPro.NET实现TextBox智能获取服务端数据功能(Asp.net 2.0)(示例代码下载)
- AjaxPro.NET实现TextBox智能获取服务端数据功能(Asp.net 2.0)(示例代码下载)
- AjaxPro.NET实现TextBox智能获取服务端数据功能(Asp.net 2.0)(示例代码下载)
- ASP.NET 2.0实现类似QQ邮箱中‘HTML方式查看’功能查看Office文件
- 无 Cookie 的 ASP.NET
- 七招制胜ASP.NET应用程序开发
- 在ASP.NET中实现多文件上传
- microsoft office web 组件(owc11)的编程(.net) (ZZ)
- 通过ADO.NET访问数据库
- ASP.NET实现HTTP方式获取功能
- 用ASP.NET设计高效邮件列表
- ASP.NET中的HTML编码和URL编码
- asp.net实现pop功能
- ASP.Net写追捕方法
- 资料验证的asp.net程序
- 在ASP.NET中使用.NET组件
- 史蒂夫·乔布斯:“好学若饥、谦卑若愚”
- 在ASP.NET中使用AdRotator控件