首页 > 开发 > 综合 > 正文

WebService实例-域名查询~

2024-07-21 02:21:15
字体:
来源:转载
供稿:网友

最大的网站源码资源下载站,

接口说明文档:
http://whois.aspsir.com/whois.asmx?wsdl
  
程序代码:

<form name="form1" method="post" action="test.asp">
<table width="318" border="0" cellpadding="2" cellspacing="0">
<tr>
<td width="36"><div align="right">www.</div></td>
<td width="218"><input name="strdomain" type="text" id="strdomain" value="stefli.com" size="30" maxlength="30"></td>
<td width="42"><input type="submit" name="submit" value="查询"></td>
</tr>
</table>
</form>
<%
strdomain = request.form("strdomain")
strurl = "http://whois.aspsir.com/whois.asmx/lookup?strdomain=" & strdomain & ""
set oxmlhttp = server.createobject("microsoft.xmlhttp")
oxmlhttp.open "get", strurl, false
oxmlhttp.send()
if oxmlhttp.readystate <> 4 then response.write err.description
strresult = bytes2bstr(oxmlhttp.responsebody)
if instr(strresult,"no match")<>0 then
response.write "域名[www." & strdomain & "]居然还没有被注册!"
else
response.write "呵呵,来晚了一步!域名已经被注册~"
end if
set oxmlhttp = nothing

function bytes2bstr(vin)
dim strreturn
dim i, thischarcode, nextcharcode
strreturn = ""
for i = 1 to lenb(vin)
thischarcode = ascb(midb(vin, i, 1))
if thischarcode < &h80 then
strreturn = strreturn & chr(thischarcode)
else
nextcharcode = ascb(midb(vin, i + 1, 1))
strreturn = strreturn & chr(clng(thischarcode) * &h100 + cint(nextcharcode))
i = i + 1
end if
next
bytes2bstr = strreturn
end function
%>
<br>
<br>
接口说明文档:<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;http://whois.aspsir.com/whois.asmx?wsdl

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表