用ASP获取别的网页的内容
类别: ASP教程
<HTML>
<HEAD>
<title>Get URL Text</title>
</HEAD>
<BODY>
<!-- Author: Adrian Forbes -->
<form action="URLGetMSINet.asp">
<table border=0>
<tr><td>URL</td><td><input type=text name=txtURL value=""></td></tr>
</table>
<input type=submit value="Get Text">
</form>
</BODY>
</HTML>
***这是URLGetMSInet.asp
<%@ Language=VBScript %>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<title>Get URL Text</title>
</HEAD>
<BODY>
<!-- Author: Adrian Forbes -->
<%
\'Set obj = CreateObject("InetCtls.Inet")
Set obj = Server.CreateObject("InetCtls.Inet.1")
obj.RequestTimeOut=20
sRequest = trim(Request("txtURL"))
sText = obj.OpenURL (CStr(sRequest))
sText = "<pre>" & vbcrlf & Server.HTMLEncode(sText) & vbCRLF & "</pre>"
Response.Write sText
set obj = nothing
%>
</BODY>
</HTML>
<HEAD>
<title>Get URL Text</title>
</HEAD>
<BODY>
<!-- Author: Adrian Forbes -->
<form action="URLGetMSINet.asp">
<table border=0>
<tr><td>URL</td><td><input type=text name=txtURL value=""></td></tr>
</table>
<input type=submit value="Get Text">
</form>
</BODY>
</HTML>
***这是URLGetMSInet.asp
<%@ Language=VBScript %>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<title>Get URL Text</title>
</HEAD>
<BODY>
<!-- Author: Adrian Forbes -->
<%
\'Set obj = CreateObject("InetCtls.Inet")
Set obj = Server.CreateObject("InetCtls.Inet.1")
obj.RequestTimeOut=20
sRequest = trim(Request("txtURL"))
sText = obj.OpenURL (CStr(sRequest))
sText = "<pre>" & vbcrlf & Server.HTMLEncode(sText) & vbCRLF & "</pre>"
Response.Write sText
set obj = nothing
%>
</BODY>
</HTML>
-= 资 源 教 程 =-
文 章 搜 索