Use ASP to obtain the specified content of the remote webpage, you can easily get some of the specified contents of the webpage of others. In fact, the principle of the ASP thief program. Friends who need it can refer to it.
The code is as follows:
<%
'Use ASP to obtain the specified content of the remote target web page, the code is provided by the Guangzhou website to build http://www.vevb.com
On error resume next
Server.scripttimeout = 9999999
Function Gethttppage (PATH)
T = Getbody (PATH)
Gethttppage = Bytestobstr (T, GB2312)
End function
Function Newstring (WSTR, StRNG)
NewString = Instr (LCASE (WSTR), LCASE (STRNG))
if newString <= 0 then newstring = len (WSTR)
End function
Function Bytestobstr (Body, CSET)
dim objstream
set objstream = Server.createObject (Adodb.Stream)
objstream.type = 1
objstream.mode = 3
objstream.open
objstream.write?
objstream.position = 0
objstream.type = 2
objstream.charset = CSET
Bytestobstr = Objstream.readtext
objstream.close
set objstream = Nothing
End function
Function getBody (url)
On error resume next
Set Retrieval = CreateObject (Microsoft.xmlhttp)
With retrieval
.Opeen get, url, false,,,,,,
.Send
Getbody = .Responsebody
End with
Setrieval = Nothing
End function
'ASP gets the specified content of the remote web page start, starting
DIM WSTR, Str, URL, Start, Over, DTIME
A = Start content 'ASP Get the target webpage content and start marking
b = End content 'ASP to get the web content end mark
url = http://sc.vevb.com/
WSTR = Gethttppage (URL)
start = newString (WSTR, A)
OVER = Newstring (WSTR, B)
Body = MID (WSTR, Start, Over-Start)
Response.write & body & 'Output obtained webpage content
'ASP Get the specified content of the remote web page ends
%>
The above code can get the content of the specified webpage.
Core code:
'ASP gets the specified content of the remote web page start, starting
DIM WSTR, Str, URL, Start, Over, DTIME
url = http://sc.vevb.com/
WSTR = Gethttppage (URL)
Body = WSTR