<%
Dim myRegExp
set myRegExp=New RegExp
myRegExp.Pattern = "[^a-z0-9_]"
myRegExp.Global=True
for each Req in Request.Querystring
ReqV=Request.Querystring(Req)
if trim(ReqV)<>"" then
ReqV=replace(ReqV,"""","""""")
Req=myRegExp.Replace(Req,"")
Execute(Req&"="""&ReqV&"""")
end if
next
response.write a
%>
< %
'ASP获取文章列表
function getHTTPPage(url)
dim Http
set Http=server.createobject("MSXML2.XMLHTTP")
Http.open "GET",url,false
Http.send()
if Http.readystate<>4 then
exit function
end if
getHTTPPage=bytesToBSTR(Http.responseBody,"GB2312")
set http=nothing
if err.number<>0 then err.Clear
end function
Function BytesToBstr(body,Cset)
dim objstream
set objstream = Server.CreateObject("adodb.stream")
objstream.Type = 1
objstream.Mode =3
objstream.Open
objstream.Write body
objstream.Position = 0
objstream.Type = 2
objstream.Charset = Cset
BytesToBstr = objstream.ReadText
objstream.Close
set objstream = nothing
End Function
Function ZZ(ustr,uexp)
Set regEx=New RegExp
regEx.Pattern=uexp
regEx.IgnoreCase=True
regEx.Global=True
Set ZZ=regEx.Execute(ustr)
End Function
Sub Echo(t)
response.write t&"<br />"&vbcrlf
End Sub
Sub getall(url,xurl,uri)
Html = getHTTPPage(uri&Url)
set Rs=ZZ(html,"("&xurl&"?.*)[#""].*>(.*)< \/a")
for each uurl in Rs
'echo uri&replace(uurl,"""","")
Set oMacs=uurl
echo uri&oMacs.SubMatches(0)&"|"&oMacs.SubMatches(1)
next
End Sub
urls=split("ftgb|ftlg|zykt","|")
xurls=split("ftgbxx|ftlgxx|zyktcpxx","|")
for i=0 to ubound(urls)
getall urls(i)&".jsp",xurls(i)&".jsp","http://gree.com.cn/gree_product/"
next
%>
下边发个VBscript版本的
'VBScript获取文章列表
function getHTTPPage(url)
dim Http
set Http=createobject("MSXML2.XMLHTTP")
Http.open "GET",url,false
Http.send()
if Http.readystate<>4thenexitfunctionendif
getHTTPPage=bytesToBSTR(Http.responseBody,"GB2312")
set http=nothingif err.number<>0then err.Clear
endfunctionFunction BytesToBstr(body,Cset)
dim objstream
set objstream =CreateObject("adodb.stream")
objstream.Type =1
objstream.Mode =3
objstream.Open
objstream.Write body
objstream.Position =0
objstream.Type =2
objstream.Charset = Cset
BytesToBstr = objstream.ReadText
objstream.Close
set objstream =nothingEndFunctionFunction ZZ(ustr,uexp)
Set regEx=New RegExp
regEx.Pattern=uexp
regEx.IgnoreCase=True
regEx.Global=TrueSet ZZ=regEx.Execute(ustr)
EndFunctionSub Echo(t)
Wscript.echo t
EndSubSub getall(url,xurl,uri)
Html = getHTTPPage(uri&Url)
set Rs=ZZ(html,"("&xurl&"?.*)[#""].*>(.*)< \/a")
foreach uurl in Rs
'echo uri&replace(uurl,"""","")
Set oMacs=uurl
echo uri&oMacs.SubMatches(0)&"|"&oMacs.SubMatches(1)
nextEndSub
urls=split("ftgb|ftlg|zykt","|")
xurls=split("ftgbxx|ftlgxx|zyktcpxx","|")
for i=0toubound(urls)
getall urls(i)&".jsp",xurls(i)&".jsp","http://gree.com.cn/gree_product/"next
'VBScript获取文章列表
function getHTTPPage(url)
dim Http
set Http=createobject("MSXML2.XMLHTTP")
Http.open "GET",url,false
Http.send()
if Http.readystate<>4 then
exit function
end if
getHTTPPage=bytesToBSTR(Http.responseBody,"GB2312")
set http=nothing
if err.number<>0 then err.Clear
end function
Function BytesToBstr(body,Cset)
dim objstream
set objstream = CreateObject("adodb.stream")
objstream.Type = 1
objstream.Mode =3
objstream.Open
objstream.Write body
objstream.Position = 0
objstream.Type = 2
objstream.Charset = Cset
BytesToBstr = objstream.ReadText
objstream.Close
set objstream = nothing
End Function
Function ZZ(ustr,uexp)
Set regEx=New RegExp
regEx.Pattern=uexp
regEx.IgnoreCase=True
regEx.Global=True
Set ZZ=regEx.Execute(ustr)
End Function
Sub Echo(t)
Wscript.echo t
End Sub
Sub getall(url,xurl,uri)
Html = getHTTPPage(uri&Url)
set Rs=ZZ(html,"("&xurl&"?.*)[#""].*>(.*)< \/a")
for each uurl in Rs
'echo uri&replace(uurl,"""","")
Set oMacs=uurl
echo uri&oMacs.SubMatches(0)&"|"&oMacs.SubMatches(1)
next
End Sub
urls=split("ftgb|ftlg|zykt","|")
xurls=split("ftgbxx|ftlgxx|zyktcpxx","|")
for i=0 to ubound(urls)
getall urls(i)&".jsp",xurls(i)&".jsp","http://gree.com.cn/gree_product/"
next