getTitle.asp这个是你的代理服务器页面,然后把这个页面用iframe引用到你的静态页面就可以了. Function PostHttpPage(PostUrl) Dim xmlHttp Set xmlHttp =server.CreateObject("Msxml2.XMLHTTP") xmlHttp.Open "GET",PostUrl,False xmlHttp.send() If Err.Number<>0 Then Set xmlHttp=Nothing PostHttpPage ="无法获取内容!" Exit Function End If PostHttpPage=bytesToBSTR(xmlHttp.responseBody,"GB2312") Set xmlHttp=nothing End FunctionFunction BytesToBstr(strBody,CodeBase) dim obj set obj=Server.CreateObject("Adodb.Stream_0418s") obj.Type=1 obj.Mode=3 obj.Open obj.Write strBody obj.Position=0 obj.Type=2 obj.Charset=CodeBase BytesToBstr=obj.ReadText obj.Close set obj=nothing End Function Function GetTitle(PostUrl) dim Body:Body=PostHttpPage(PostUrl) dim Reg set Reg=new RegExp Reg.Global=true Reg.IgnoreCase=true Reg.Pattern="<title>([^>]*)</title>" dim Match:set Match=Reg.Execute(Body) for each m in match GetTitle=m.submatches(0) exit function next set Reg=nothing GetTitle="没有标题" End Function response.clear response.ContentType="text/plain" response.CharSet="gb2312" response.write GetTitle("http://www.baidu.com/") response.endtest.htm <iframe src='gettitle.asp'></iframe>
Function BytesToBstr(strBody,CodeBase) dim obj 'set obj=Server.CreateObject("Adodb.Stream_0418s") '这里改下键值........,我改过注册表了 set obj=Server.CreateObject("Adodb.Stream") obj.Type=1 obj.Mode=3 obj.Open obj.Write strBody obj.Position=0 obj.Type=2 obj.Charset=CodeBase BytesToBstr=obj.ReadText obj.Close set obj=nothing End Function
Function PostHttpPage(PostUrl)
Dim xmlHttp
Set xmlHttp =server.CreateObject("Msxml2.XMLHTTP")
xmlHttp.Open "GET",PostUrl,False
xmlHttp.send()
If Err.Number<>0 Then
Set xmlHttp=Nothing
PostHttpPage ="无法获取内容!"
Exit Function
End If
PostHttpPage=bytesToBSTR(xmlHttp.responseBody,"GB2312")
Set xmlHttp=nothing
End FunctionFunction BytesToBstr(strBody,CodeBase)
dim obj
set obj=Server.CreateObject("Adodb.Stream_0418s")
obj.Type=1
obj.Mode=3
obj.Open
obj.Write strBody
obj.Position=0
obj.Type=2
obj.Charset=CodeBase
BytesToBstr=obj.ReadText
obj.Close
set obj=nothing
End Function Function GetTitle(PostUrl)
dim Body:Body=PostHttpPage(PostUrl)
dim Reg
set Reg=new RegExp
Reg.Global=true
Reg.IgnoreCase=true
Reg.Pattern="<title>([^>]*)</title>"
dim Match:set Match=Reg.Execute(Body)
for each m in match
GetTitle=m.submatches(0)
exit function
next
set Reg=nothing
GetTitle="没有标题"
End Function
response.clear
response.ContentType="text/plain"
response.CharSet="gb2312"
response.write GetTitle("http://www.baidu.com/")
response.endtest.htm
<iframe src='gettitle.asp'></iframe>
dim obj
'set obj=Server.CreateObject("Adodb.Stream_0418s")
'这里改下键值........,我改过注册表了
set obj=Server.CreateObject("Adodb.Stream")
obj.Type=1
obj.Mode=3
obj.Open
obj.Write strBody
obj.Position=0
obj.Type=2
obj.Charset=CodeBase
BytesToBstr=obj.ReadText
obj.Close
set obj=nothing
End Function