用ASP做一个域名查询系统
<%
On Error Resume Next
Server.ScriptTimeOut=9999999
Function getHTTPPage(Path)
t = GetBody(Path)
getHTTPPage=BytesToBstr(t,"GB2312")
End function
Function GetBody(url)
on error resume next
Set Retrieval = CreateObject("Microsoft.XMLHTTP")
With Retrieval
.Open "Get", url, False, "", ""
.Send
GetBody = .ResponseBody
End With
Set Retrieval = Nothing
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
%>
<%
if request("domain")<>"" then
url="https://www.onlinenic.com//cgi-bin/4e/check_domain.cgi?type_encode=1&domain="&request("domain")&"&root="&request("root")
wstr=getHTTPPage(url)
'response.write Instr (wstr,"可以注册")
start=Newstring(wstr,"查询域名结果")
over=Newstring(wstr,"按此返回")
body=mid(wstr,start+0,over-start)
body=replace(body,"查询域名结果","")
body=replace(body,"</b></font></div><br>","")
body=replace(body,"javascript:tmp=openwin('/cgi-bin/4e/whois.cgi?domain=","whois.asp?domain=")
body=replace(body,"')","")
body=replace(body,"<center><a href='http://www.OnlineNIC.com/4e/'>","")
body=replace(body,"<b>没有被注册</b>","<b><a href='http://www.reg.com?reg.asp?domain="+request("domain")+request("root")+"'>没有被注册</a></b>")
if body="" then response.write "域名查询有错误!"
response.write body
end if
%>
<p align="center">
<iframe marginwidth=0 marginheight=0 frameborder=0 bordercolor='#000000' scrolling=no src='http://union.sogou.com/cpc/partner.php?pid=hljec&type=12' width=590 height=95></iframe>
</p>
<table width="40%" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#999999">
<tr>
<td height="26" bgcolor="efefef">域名查询系统</td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><form name="form1" method="post" action="
相关新闻>>
- 发表评论
-
- 最新评论 更多>>