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

ASP
TSYS 新闻列表JS调用下载
使用asp代码突破图片的防盗连
一种理论上最快的Web数据库分页方法
asp:debug类调试程序
如何增加Referer功能--反向链接插件
pjblog中清空引用的小程序
光碟工具 Alcohol 120% v1.9.6.4719 下载(附序列号注册码)
ASP实现头像图像随机变换
UTF-8 Unicode Ansi 汉字GB2321几种编码转换程序
[转]XMLHTTPRequest的属性和方法简介
ASP常用函数:getpy()
我用ASP写的m行n列的函数,动态输出创建TABLE行列
ASP常用函数:Delay()
ASP常用函数:Trace()
[转]ASP实现关键词获取(各搜索引擎,GB2312及UTF-8)
对象标记具有无效的 ''MSWC.MyInfo'' ProgID
ServerVariables集合检索预定的环境变量
HTTP_HOST 和 SERVER_NAME 的区别详解
[转]ASP常用函数:TimeZone
Eval 函数 | Execute 语句 | ExecuteGlobal 语句

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


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 225 ::
收藏到网摘: 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>