on error resume next
domain1=request("domain")
ext=request("ext")
Information=false
if ext="" or ext=empty then
domain=domain1
else
domain=domain1&"."&ext
end if
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 GetURL(url,ext)
Set Retrieval = Server.CreateObject("Microsoft.XMLHTTP")
With Retrieval
.Open "GET", url, False, "", ""
.Send
if instr(ext,"cn")<>0 then
GetURL = .responseText
else
GetURL = .responsebody
GetURL= bytes2bstr(GetURL)
GetURL=trim(GetURL)
end if
End With
Set Retrieval = Nothing
End Function
if ext<>"" then
if ext="com" or ext="net" or ext="org" or ext="biz" or ext="info" then
TakenHTML = GetURL("http://www-whois.internic.net/cgi/whois?type=domain&whois_nic=" & Domain,ext)
pageafter = "<pre>"
pagebefore = "</pre>"
end if
if instr(ext,"cn")<>0 then
TakenHTML = GetURL("http://ewhois.cnnic.net.cn/whois?entity=domain&value="&Domain,ext)
pageafter = "<table border=1 cellspacing=0 cellpadding=2>"
pagebefore = "</table>"
end if
if ext="中国" or ext="公司" or ext="网络" then
TakenHTML = GetURL("http://cwhois.cnnic.net.cn/whois.jsp?entityname=domain&queryinfo=" &Domain,ext)
pageafter = "<table border=1 cellspacing=0 cellpadding=2>"
pagebefore = "</table>"
end if
tempcontent=TakenHTML
if TakenHTML="" then
TakenHTML="查询有错"
else
if instr(TakenHTML,"没有被注册")<>0 then
TakenHTML="此域名没有被注册"
else
if instr(1,TakenHTML,pageafter,1)<>0 then
pagestart=InStr(1,tempcontent, pageafter,1)+ Len(pageafter) + 1
pageend=instr(pagestart,tempcontent,pagebefore,1)
pageend = pageend - pagestart
TakenHTML = Mid(tempcontent, pagestart, pageend)
TakenHTML=pageafter&TakenHTML&pagebefore
end if