用ASP获取别的网页的内容

发表于:2007-06-30来源:作者:点击数: 标签:
HTML HEAD titleGet URL Text/title /HEAD BODY !-- Author: Adrian Forbes -- form action=URLGetMSINet.asp table border=0 tr td URL/tdtdinput type=text name=txtURL value=/td/tr /table input type=submit value=Get Text /form /BODY /HTML ***这是UR
<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>

***这是URLGetMS.net.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>

原文转自:http://www.ltesting.net