用ASP获取title
作者:刚子 日期:2008-11-13
代码很容易看懂,利用这个代码可以达到很多效果,比如做小偷程序,找了好久找到的。网上还有个比这个流行的,但是那个很多杀软都会报毒,所以我使用这个,贴上代码:
程序代码
程序代码<%
function gethttppage(url)
dim adxmlhttp
set adxmlhttp = Server.createobject("microsoft.xmlhttp")
adxmlhttp.open "get",url,false
adxmlhttp.send()
if adxmlhttp.readystate <> 4 then exit function
gethttppage = Bytes2bStr(adxmlhttp.responsebody)
set adxmlhttp = nothing
End function
function Bytes2bStr(vin)
Dim BytesStream,StringReturn
Set BytesStream = Server.CreateObject("adodb.stream")
BytesStream.Type = 2
BytesStream.Open
BytesStream.WriteText vin
BytesStream.Position = 0
BytesStream.Charset = "GB2312"
BytesStream.Position = 2
StringReturn =BytesStream.ReadText
BytesStream.close
Set BytesStream = Nothing
Bytes2bStr = StringReturn
End function
url = "http://www.654.la"
str = gethttppage(url)
Function GetPageTitle(HtmlContent)
Dim l,j,strTitle
l = InStr(LCase(HtmlContent), "<title>")
If l > 0 Then
l = l + 7
j = InStr(l, LCase(HtmlContent), "</title>")
If j > 0 Then
strTemp = Mid(HtmlContent, l, j - l)
Else
strTemp = "没有标题"
End If
Else
strTemp = "没有标题"
End If
GetPageTitle = strTemp
End Function
HtmlCldeContent = getHTTPPage(""&url&"")
Title = GetPageTitle(HtmlCldeContent)
response.write(Title)
%>
function gethttppage(url)
dim adxmlhttp
set adxmlhttp = Server.createobject("microsoft.xmlhttp")
adxmlhttp.open "get",url,false
adxmlhttp.send()
if adxmlhttp.readystate <> 4 then exit function
gethttppage = Bytes2bStr(adxmlhttp.responsebody)
set adxmlhttp = nothing
End function
function Bytes2bStr(vin)
Dim BytesStream,StringReturn
Set BytesStream = Server.CreateObject("adodb.stream")
BytesStream.Type = 2
BytesStream.Open
BytesStream.WriteText vin
BytesStream.Position = 0
BytesStream.Charset = "GB2312"
BytesStream.Position = 2
StringReturn =BytesStream.ReadText
BytesStream.close
Set BytesStream = Nothing
Bytes2bStr = StringReturn
End function
url = "http://www.654.la"
str = gethttppage(url)
Function GetPageTitle(HtmlContent)
Dim l,j,strTitle
l = InStr(LCase(HtmlContent), "<title>")
If l > 0 Then
l = l + 7
j = InStr(l, LCase(HtmlContent), "</title>")
If j > 0 Then
strTemp = Mid(HtmlContent, l, j - l)
Else
strTemp = "没有标题"
End If
Else
strTemp = "没有标题"
End If
GetPageTitle = strTemp
End Function
HtmlCldeContent = getHTTPPage(""&url&"")
Title = GetPageTitle(HtmlCldeContent)
response.write(Title)
%>
评论: 0 | 引用: 0 | 查看次数: -
发表评论
上一篇
下一篇

文章来自:
Tags: