楼上兄弟,试过没有?不行啊。
得到的结果是:
To see the Whois Record for 221.216.169.120 you will need to sign-up for a free account. We restrict how many whois records we give out to anonymous users per day. Sorry for the precaution but we need to limit wandering robots for the protection of everyone.
<%
Function bytes2BSTR(vIn)
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 PostData(strurl)
dim mXmlHttp
set mXmlHttp=Server.CreateObject("Msxml2.ServerXMLHTTP")
mXmlHttp.open "GET",strurl,false
mXmlHttp.setRequestHeader "Accept", "*/*"
mXmlHttp.setRequestHeader "Accept-Language","zh-cn"
mXmlHttp.setRequestHeader "UA-CPU","x86"
mXmlHttp.setRequestHeader "Accept-Encoding","gzip, deflate"
mXmlHttp.setRequestHeader "User-Agent","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; .NET CLR 1.1.4322)"
mXmlHttp.setRequestHeader "Host","www.whois.sc"
mXmlHttp.setRequestHeader "Connection","Keep-Alive"
mXmlHttp.setRequestHeader "Cookie","ss=732834423dc939d2d1db1b01d524abc5"
mXmlHttp.send
PostData=mXmlHttp.responseBody
end function
str=PostData("http://www.whois.sc/221.216.169.120")
Response.Write bytes2BSTR(str)
%>
不是吧,结果是这个吗?
To see the Whois Record for 221.216.169.120 you will need to sign-up for a free account. We restrict how many whois records we give out to anonymous users per day. Sorry for the precaution but we need to limit wandering robots for the protection of everyone.
上面的不对。
正确的应该是:
221.216.169.120
Blacklist Status: Listed - Cached Today (details)
Cached Whois: Cached today
Whois History: 2 records stored
Oldest: 2005-09-21
Newest: 2005-09-22
Record Type: IP Address
IP Location: China - Beijing - Beijing - Cncgroup Beijing Province Network
Reverse IP: No websites hosted using this IP address
Reverse DNS: not set
--------------------------------------------------------------------------------
% [whois.apnic.net node-2]
% Whois data copyright terms http://www.apnic.net/db/dbcopyright.html
<%@LANGUAGE="VBSCRIPT" CODEPAGE="CP_ACP"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Shift-JIS">
<%
function getHTTPPage(url)
dim Http
set Http=server.createobject("MSXML2.XMLHTTP")
'Http.open "GET",url,false
Http.open "POST",url,false
Http.send()
if Http.readystate<>4 then
exit function
end if
'getHTTPPage=bytesToBSTR(Http.responseBody,"GB2312")
getHTTPPage=bytesToBSTR(Http.responseBody,"Shift-JIS")
set http=nothing
if err.number<>0 then
err.Clear
end if
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 Newstring(wstr,strng)
Newstring=Instr(lcase(wstr),lcase(strng))
if Newstring<=0 then Newstring=Len(wstr)
End Function
%>
<title></title>
</head>
<body>
<%
Dim Url,Html
Url= "http://www.whois.sc/221.216.169.120"
Html = getHTTPPage(Url)
start=Newstring(Html,"<table width=700 border=")
over=Newstring(Html,"</td></tr></table></td></tr></table>")
bodytext=mid(Html,start,over-start)
Response.write bodytext
%>
</body>
</html>
Dim strStrem,objGetPage
ServerURL = strPageUrl
Set objGetPage = Server.CreateObject("CDO.Message")
objGetPage.CreateMHTMLBody ServerURL,31
strStrem = objGetPage.HTMLBody
Set objGetPage = Nothing
getPageFromUrl = strStrem
end function
<%@LANGUAGE="VBSCRIPT" CODEPAGE="CP_ACP"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Shift-JIS">
<SCRIPT LANGUAGE="JavaScript">
<!--
function SelText(){
var oRangeRef = document.body.createTextRange();
alert(oRangeRef.text);
}
//-->
</SCRIPT>
<%
function getHTTPPage(url)
dim Http
set Http=server.createobject("MSXML2.XMLHTTP")
'Http.open "GET",url,false
Http.open "POST",url,false
Http.send()
if Http.readystate<>4 then
exit function
end if
'getHTTPPage=bytesToBSTR(Http.responseBody,"GB2312")
getHTTPPage=bytesToBSTR(Http.responseBody,"Shift-JIS")
set http=nothing
if err.number<>0 then
err.Clear
end if
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
%>
<title></title>
</head>
<body onload="SelText()">
<%
Dim Url,Html
Url= "http://www.whois.sc/221.216.169.120"
Html = getHTTPPage(Url)
Response.write Html
%>
</body>
</html>