<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> http://whois.aspsir.com/whois.asmx?wsdl