当前位置: 首页 > 图文教程 > 网络编程 > ASP > 域名登记查询(whois)很复杂吗--方法二

ASP
ASP下经常用的字符串等函数参考资料
asp下连接数据库 ASP链接数据库字符串大全总结
asp内置对象 ObjectContext 事务管理 详解
asp 内置对象 Application 详解
ASP中 SQL语句 使用方法
ASP 中 Split 函数的实例分析
ASP 中 DateDiff 函数详解 主要实现两日期加减操作
asp 存贮过程 (SQL版asp调用存储过程)
利用ASP实现在线生成电话图片效果脚本附演示
使用ASP记录在线用户的数量的代码
关于ASP生成伪参数技巧 简洁实用的伪(僞)参数
asp 关键词字符串分割如何实现方法
用ASP编写的加密和解密类
ASP之处理用Javascript动态添加的表单元素数据的代码
asp下最常用的19个基本技巧
一些Asp技巧和实用解决方法
asp实现一个统计当前在线用户的解决方案
asp下的一个很简单的验证码程序
asp又一个分页的代码例子
asp实现防止从外部提交数据的三种方法

ASP 中的 域名登记查询(whois)很复杂吗--方法二


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 211 ::
收藏到网摘: n/a

  voodoo发表于 2000-06-03 22:42:07<%@ Language=VBScript %>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY>
<form action=whois.asp method=post>
域名:www<B>.</B> <INPUT size=8 name=domainname value="<% =request("domainname") %>">. <SELECT name=ext>
<OPTION selected>com</OPTION>
<OPTION>net</OPTION>
<OPTION>org</OPTION>
<OPTION>com.cn</OPTION> <OPTION>net.cn</OPTION> <OPTION>org.cn</OPTION>
</SELECT>
<INPUT class=input1 type=submit value=域名查询 name=Submit>
                </form>
                
<%
dim strResult
if Request.ServerVariables("request_method")="POST" THEN
dim strQuery
'取得需要查询的域名
strQuery=request("domainname") & "." & request("ext")

dim objSock
'创建sock对象
Set objSock=Server.CreateObject("Aspsock.conn")
'设置whois服务器为rs.internic.net
select case request("ext")
case "com","net","org"
objSock.RemoteHost="rs.internic.net"
gj=0
case "com.cn","net.cn","org.cn"
objSock.RemoteHost="drop.cnnic.net.cn"
gj=1
end select
'设置whois服务器端口为43
objSock.Port=43
'设置操作的超时为60秒
objSock.TimeOut=60
'打开与remotehost的连接,返回真为成功
if objSock.Open then
'发出查询 WriteLn表示用vbCrlf终结(strQuery & vbCRlf)
objSock.WriteLn strQuery
'读取返回值,最大长度为65535
strResult=objSock.ReadBytesAsString(65535)
'关闭连接
objSock.Close
'打印查询结果,你可以需要对此作些处理
' Response.Write "<b>查询结果</b><br><textarea rows=10 cols=60>" & strResult & "</textarea>"
select case gj
case "0"
str1=inter(strresult)
response.write str1
Response.Write "<b>查询结果</b><br><textarea rows=10 cols=60>" & strResult & "</textarea>"
case "1"
str1=cnnic(strresult)
response.write str1
Response.Write "<b>查询结果</b><br><textarea rows=10 cols=60>" & strResult & "</textarea>"
end select
end if
Set objSock=Nothing

end if

function inter(str)
if instr(str,"No match")=0 then
response.write "您的域名已经被注册。"
else
response.write "您的域名没有被注册。"
end if
end function

function cnnic(str)
if instr(str,"%")=0 then
response.write "您的域名已经被注册。"
else
response.write "您的域名没有被注册。"
end if
end function
%>
                

</BODY>
</HTML>