ASP域名查询怎么做?

flashweb 2006-05-15 10:55:58
请问大家,用ASP如何做域名查询?我只能做对单一的域名进行查询。
我想做跟其它网站上一样的,可以对多个域名进行同时查询。
...全文
257 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
ingodview 2006-07-26
  • 打赏
  • 举报
回复

到下面的网站看看,不错的域名查询系统:
有代码免费下载

http://www.navio.cn/nwhois
zhangjingcheng 2006-05-16
  • 打赏
  • 举报
回复
源码!
改一下就可以用的form method="post" action="http://www.xxxxxx/index.asp?c=x" name="checkdomain
zhangjingcheng 2006-05-16
  • 打赏
  • 举报
回复
<HTML><HEAD>
<title></title>
<style type="text/css">
<!--
body { font-family: "宋体"; font-size: 9pt}
.style2 {color: #663300}
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language=javascript1.2>

function CheckIfEnglish( String )
{
var Letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890-";
var i;
var c;
if(String.charAt( 0 )=='-')
return false;
if( String.charAt( String.length - 1 ) == '-' )
return false;
for( i = 0; i < String.length; i ++ )
{
c = String.charAt( i );
if (Letters.indexOf( c ) < 0)
return false;
}
return true;
}
function submitchecken() {

if (document.checkdomain.domain.value == "") {
alert("请输入您要查询的英文域名。");
document.checkdomain.domain.focus();
return false;
}

if (!CheckIfEnglish(document.checkdomain.domain.value )) {
alert("\t注意:在查询英文域名时应输入英文不能输入中文及非法字符!\n域名由不分大小写的英文字母和数字组成,除了开头和结尾以外,中间也可以含有“-”(即连字符或称减号)最大长度为26个字符;");
document.checkdomain.domain.focus();
return false;
}

return true;
}
</script>
</HEAD>
<BODY>
<%
if request("c")="x" then
on error resume next
Private d_exsit
Dim Retrieval
Dim Domain
Dim TakenHTML

Function GetURL(url)
Set Retrieval = Server.CreateObject("Microsoft.XMLHTTP")
With Retrieval
.Open "GET", url, False, "", ""
.Send
GetURL = .ResponseText
End With
Set Retrieval = Nothing
End Function
Domain = Replace(Request.Form("domain"),"www.","") & "." & Request.Form("ext")
if Domain=".com" or Request.Form("domain")="" then
Response.Write ("<script>alert('看看您什么忘记填写了?没有填写域名吧?');javascript:history.back(1)</script>")
response.end
end if

TakenHTML = GetURL("http://www.china-channel.com/checkdomain.asp?action=whois&domain=" & Domain)
d_exsit=1
if InStr(TakenHTML,"No entries") > 1 then

Response.Write Domain & "出错了,请返回!<br><br>"
response.End()
end if
if InStr(TakenHTML,"No match") > 1 then
response.Write("<script>alert('"&Domain&"还没有被注册');javascript:history.back(1)</script>")
response.End()
else
response.Write("<script>alert('"&Domain&"已经被注册');javascript:history.back(1)</script>")
response.End()
end if
%>
<%
Function dowith()
Dim lStrURL
Dim pagebefore
Dim pageafter
Dim tempcontent
Dim pagestart
Dim pageend
dim temps
pageafter = "<PRE>"
pagebefore = "</PRE>"
tempcontent = TakenHTML
if d_exsit<>0 then
pagestart = InStr(1,tempcontent, pageafter,1)
If pagestart = 0 Then
dowith = "<font color=""red"">意外的错误2!</font>"
d_exsit = 3
Exit Function
Else
pagestart = pagestart + Len(pageafter) + 1
pageend = InStr(pagestart, tempcontent, pagebefore,1)
If pageend = 0 Then
dowith = "<font color=""red"">意外的错误!</font>"
d_exsit = 3
Exit Function
Else
pageend = pageend - pagestart '得到内容长度
tempcontent = Mid(tempcontent, pagestart, pageend)
End If
End If
Set pageregexp = New RegExp
pageregexp.Global = True
pageregexp.Pattern = "<[^>]*>"
tempcontent = pageregexp.Replace(tempcontent, "")
Set pageregexp = Nothing
dowith = tempcontent
End If
End Function
end if
%>
<form method="post" action="http://www.czzy.net.cn/index.asp?c=x" name="checkdomain" id=Form1>
<p>  <span class="style2">英文域名查询</span>:www.
<input name="domain" type="text" id=Text1 size="20">
<select name="ext" id=Select1>
<option value="com" selected>.com</option>
<option value="net">.net</option>
<option value="org">.org</option>
<option value="com.cn">.com.cn</option>
<option value="net.cn">.net.cn</option>
<option value="org.cn">.org.cn</option>
<option value="cc">.cc</option>
<option value="tv">.tv</option>
<option value="biz">.biz</option>
<option value="info">.info</option>
<option value=".cn">.cn</option>
<option value=".cc">.cc</option>
</select>
<input type="submit" name="Submit" value="查询" id=Submit1 onClick = "return submitchecken();">
</p>
</form>
</BODY>
</HTML>
flashweb 2006-05-16
  • 打赏
  • 举报
回复
老大,我到哪里去找whois服务器的接口代码呀!
bryankoul 2006-05-15
  • 打赏
  • 举报
回复
需要接口的,你需要先找一个whois服务器的接口代码
比如新网的,万网的
然后调用

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧