您现在的位置:计算机技术学习网 > 技术中心 > WEB编程 > ASP >

用ASP做一个域名查询系统

来源:网络收集 责任编辑:栏目编辑 发表时间:2013-07-02 00:18 点击:


<%
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="

    发表评论
    请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
    用户名: 验证码:点击我更换图片
    最新评论 更多>>

    推荐热点

    • WAP常见问题问答大全(四)
    • ASP开发必备:WEB打印代码大全
    • ASP调用系统ping命令
    • asp缓存技术
    • ASP教程:第三篇 ASP基础
    • 用ASP+XML打造留言本(4)
    • 关于ASP Recordset 分页出现负数解决方法及建议
    • 用asp怎样编写文档搜索页面(5)
    • ASP处理多关键词查询实例代码
    网站首页 - 友情链接 - 网站地图 - TAG标签 - RSS订阅 - 内容搜索
    Copyright © 2008-2015 计算机技术学习交流网. 版权所有

    豫ICP备11007008号-1