没别的,看看吧:
<%
on error resume next
Server.ScriptTimeOut=120
url = "http://www.kj2000.com/xinwen/Detail01.asp?TitleID=595" '新闻来源的页面
wstr = getHTTPPage(url) '取得页面内容
if err.number=0 then
start=newstring(wstr," <table border=""0"" cellspacing=""0"" cellpadding=""0"" width=""100%"" bgcolor=""#F9F9F9"">")
over=newstring(wstr,"<table width=""760"" border=""0"" cellspacing=""0"" cellpadding=""0"" align=""center"">")
wstr=mid(wstr,start,over-start)
wstr=replace(wstr,"#009999","#ffffff")
wstr=replace(wstr,"#FFFF80","#000000")
wstr=replace(wstr,"Cellspacing=5","Cellspacing=0")
wstr=replace(wstr,"HREF=Detail01.asp?TitleID=","HREF=news_view.asp?id=Detail01.asp?TitleID=")
end if
response.write wstr
function getHTTPPage(url)
on error resume next
dim http
set http=Server.createobject("Microsoft.XMLHTTP")
Http.open "GET",url,false
Http.send()
if Http.readystate<>4 then
exit function
end if
getHTTPPage=bytes2BSTR(Http.responseBody)
set http=nothing
if err.number<>0 then err.Clear
end function
Function bytes2BSTR(vIn)
dim strReturn
dim i,ThisCharCode,NextCharCode
strReturn = ""
For i = 1 To LenB(vIn)
ThisCharCode = AscB(MidB(vIn,i,1))
If ThisCharCode < &H80 Then
strReturn = strReturn & Chr(ThisCharCode)
Else
NextCharCode = AscB(MidB(vIn,i+1,1))
strReturn = strReturn & Chr(CLng(ThisCharCode) * &H100 + CInt(NextCharCode))
i = i + 1
End If
Next
bytes2BSTR = strReturn
End Function
Function NewString(wstr,strng)
NewString=Instr(wstr,strng)
End Function
%>