日期:2011-10-13 浏览次数:21285 次
<scriptlanguage="vbscript">
Subsubmit1_onmouseup'当点击“查询”按钮时触发;
DimobjXML,objXSL,objFSO,strFile,strFileName,strXSL,strURL,TheForm
SetTheForm=Document.wordfind
window.status="正在检索数据···"
strURL="dns.asp"
SetobjXML=CreateObject("Microsoft.XMLHTTP")'创建MS的XMLHTTP组件;
stra="submit=submit&fqdn="&TheForm.words.value
objXML.Open"post",strURL,false'采用Post提交方式;
objXML.setrequestheader"content-length",len(stra)
objXML.setrequestheader"content-type","application/x-www-form-urlencoded"
objXML.sendstra'发送信息
xmlGet=objXML.responseText'稍等片刻后,得到端传回来的结果;
ifinstr(1,xmlGet,"Thisisnotavalid.com.net.org.infoor.bizdomain name",1)<1andlen(trim(xmlGet))>100then
ifinstr(1,xmlGet,"Thisdomainisavailable",1)<1then
ifinstr(1,xmlGet,"Registrant:",1)then
strFind1=instr(1,xmlGet,"Registrant:",1)
else
strFind1=instr(1,xmlGet,"<pre><FONTface=""Verdana,Arial",1)+65
strFind2=instr(1,xmlGet,"</FONT></pre>",1)
strFind4=strFind2-strFind1
sHTML=mid(xmlGet,strFind1,strFind4)
TheForm.comments.value="查询结果:"+chr(13)+chr(10)+sHTML
window.status="查询结果:该域名已被占用"
else
TheForm.comments.value="恭喜你,此域名可用!"
window.status="查询结果:该域名仍然处于可用状态!"
endif
else
TheForm.comments.value="无效的国际顶级域名!请输入以(.com.net.org.infoor.biz)结尾的国际域名,例如sun.com"
window.status="无效的国际顶级域名!请输入以(.com.net.org.infoor.biz)结尾的国际域名,例如CCTV.com"
endif
SetobjXML=Nothing
endsub
</script>
<html><head><title>XMLHTTP之域名查询篇</title></head>
<bodybgColor=#cccca3>
<formmethod="post"name=wordfindonsubmit="javascript:returnfalse">
请输入域名名称:<inputtype="text"value="cctv.com"name="words"size="69">
<inputtype="submit"value="查询"id=Submit1name=Submit1>
<TEXTAREAname=commentsreadonlyrows=10cols=76></TEXTAREA>
</form></body></html>
<%dimxmlGet,objXML,objXSL,objFSO,strFile,strFileName,strXSL,strURL
xmlGet=""
iflen(trim(Request.form("fqdn")))>1then
strURL="http://www.domainbank.net/whoisresults_gen.cfm?show=1"
'WhoIS的地址
SetobjXML=CreateObject("Microsoft.XMLHTTP")'创建MS的XMLHTTP组件
stra="submit=submit&fqdn="&trim(Request.form("fqdn"))
objXML.Open"post",strURL,false
objXML.setrequestheader"content-length",len(stra)
objXML.setrequestheader"content-type","application/x-www-form-urlencoded"
objXML.sendstra'发送信息到WhoIs;
xmlGet=objXML.responseTe