WebService執行個體-網域名稱查詢~
來源:互聯網
上載者:User
介面說明文檔:
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)