asp版域名查询的数据库接口
2009-10-08 11:11:46 来源:WEB开发网核心提示:<% on error resume next PRivate d_exsit Dim Retrieval Dim Domain Dim TakenHTML Function GetURL(url) Set Retrieval = Server.CreateObject("M
<%
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.internic.net/cgi/whois?whois_nic="&Domain&"&type=domain")
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>"
else
if InStr(TakenHTML,"No match") > 1 then %>
祝贺您,您想注册的域名 <% =Domain %> 还没有被注册<p><a href="#" >
点击这里,开始注册您的域名</a></p></font>
<% else %>
<font color="red"><br>很抱歉</font> 您想注册的域名 <% =Domain %> 已经被注册了!<p></p>请您换个域名再试</font>
<form method="post" action="search.asp" name="checkdomain" id=Form1>
www.<input type="text" name="domain" id=Text1>
<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>
</select>
<input type="submit" name="Submit" value="查询" id=Submit1 onClick = "return submitchecken();">
</form>以下是此域名的详细注册信息<BR></font>
<table><tr><td><PRE><% =dowith() %></PRE></td></tr></table></font>
<% end if
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
%>
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.internic.net/cgi/whois?whois_nic="&Domain&"&type=domain")
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>"
else
if InStr(TakenHTML,"No match") > 1 then %>
祝贺您,您想注册的域名 <% =Domain %> 还没有被注册<p><a href="#" >
点击这里,开始注册您的域名</a></p></font>
<% else %>
<font color="red"><br>很抱歉</font> 您想注册的域名 <% =Domain %> 已经被注册了!<p></p>请您换个域名再试</font>
<form method="post" action="search.asp" name="checkdomain" id=Form1>
www.<input type="text" name="domain" id=Text1>
<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>
</select>
<input type="submit" name="Submit" value="查询" id=Submit1 onClick = "return submitchecken();">
</form>以下是此域名的详细注册信息<BR></font>
<table><tr><td><PRE><% =dowith() %></PRE></td></tr></table></font>
<% end if
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
%>
- ››asp.net页面弄成伪静态页面
- ››Asp.net 中将汉字转换成拼音的方法
- ››ASP.NET及JS中的cookie基本用法
- ››ASP.NET获取MS SQL Server安装实例
- ››asp.net实现调用百度pai 在线翻译英文转中文
- ››ASP.NET页面选项进行提示判断
- ››Asp.net定时执行程序
- ››查询Oracle正在执行和执行过的SQL语句
- ››ASP.NET中利用DataList实现图片无缝滚动
- ››ASP.NET验证控件RequiredFieldValidator
- ››ASP.NET中使用System.Net.Mail发邮件
- ››ASP.NET中获取用户控件中控件的ID
更多精彩
赞助商链接