在一个网友的博客上看到的,感觉不错,转载下。 代码很容易看懂,利用这个代码可以达到很多效果,比如做小偷程序,找了好久找到的。 <% 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) %>