% Function formaturl(yes) If mid(yes,5,1)>"" then yes1 = left(yes,3) yes2 = right(yes,cint(len(yes))-3) formaturl = yes1 "." yes2 else formaturl=yes end if End Function '取得遠程網(wǎng)頁二進制源代碼 Function getBoy(url) 'on error resume next Set objXml = Server.CreateObject("Microsoft.XmlHttp") with objXml .open "get",url,false,"","" .send getBoy = .responsebody end with getBoy = BytesToBstr(GetBoy,"GB2312") Set objXml = nothing end function
'處理二進制流代碼 Function BytesToBstr(strBody,CodeBase) dim objStream set objStream = Server.CreateObject("Adodb.Stream") objStream.Type = 1 objStream.Mode =3 objStream.Open objStream.Write strBody objStream.Position = 0 objStream.Type = 2 objStream.Charset = CodeBase BytesToBstr = objStream.ReadText objStream.Close set objStream = nothing End Function %> 未注冊的域名如下 % 'www.knowsky.com如果提交了查詢 If Request.Form("yes") > "" Then yes = replace(Request.Form("yes")," ","") '去除復選框字符串中的空格 yes = split(yes,",") '實例化一個數(shù)組yes,將用逗號隔開的yes數(shù)組賦值給yes新數(shù)組
For i = 0 to ubound(yes) '遍歷數(shù)組循環(huán)開始 url = "http://panda.www.net.cn/cgi-bin/Check.cgi?domain="Request.Form("domain")"ext="yes(i) wstr = getBoy(url) '獲取查詢后的源代碼 If instr(wstr,"未被注冊的域名") > 0 Then '判斷是否為已經(jīng)注冊的域名 Response.Write Request.Form("domain")"."formaturl(yes(i))"br>br>br>br>" '列出未注冊的域名 End If Next response.Write "p>p>p>已注冊的域名如下:br>" For i = 0 to ubound(yes) '遍歷數(shù)組循環(huán)開始 url = "http://panda.www.net.cn/cgi-bin/Check.cgi?domain="Request.Form("domain")"ext="yes(i) wstr = getBoy(url) '獲取查詢后的源代碼 If instr(wstr,"已被注冊的域名") > 0 Then '判斷是否為已經(jīng)注冊的域名 Response.Write Request.Form("domain")"."formaturl(yes(i))"br>br>br>br>" '列出已注冊的域名 End If Next