<%
'常用函数
'1、输入url目标网页地址,返回值getHTTPPage是目标网页的html代码
function getHTTPPage(url)
dim Http
set Http=server.createobject("MSXML2.XMLHTTP")
Http.open "GET",url,false
Http.send()
if Http.readystate<>4 then
exit function
end if
getHTTPPage=bytesToBSTR(Http.responseBody,"GB2312")
set http=nothing
if err.number<>0 then err.Clear
end function
'2、转换乱玛,直接用xmlhttp调用有中文字符的网页得到的将是乱玛,可以通过adodb.stream组件进行转换
Function BytesToBstr(body,Cset)
dim objstream
set objstream = Server.CreateObject("adodb.stream")
objstream.Type = 1
objstream.Mode =3
objstream.Open
objstream.Write body
objstream.Position = 0
objstream.Type = 2
objstream.Charset = Cset
BytesToBstr = objstream.ReadText
objstream.Close
set objstream = nothing
End Function
'下面试着调用OnlineNIC的html内容
Dim Url,Html,MM
Url=" https://www.onlinenic.com/cgi-bin/chinese/check_domain.cgi?type_encode=1&domain="&request("domain")&"&root="&request("ext")
Html = getHTTPPage(Url)
if instr(Html,"没有被注册") then
ext=request("ext")
n=len(ext)
ext2=right(ext,n-1)
MM = "恭喜,您查询的域名<font color=#ff0000>"&request("domain")&request("ext")&"</font>可以注册!<a href=buy_domain.asp?domain="&request("domain")&"&ext="&ext2&"><img src=images/regdn.gif width=90 height=22 border=0></a>"
else
MM = "抱歉,您查询的域名<font color=#ff0000>"&request("domain")&request("ext")&"</font>不能注册,请 <a href=domain.asp>重新查询</a> 。"
end if
%>
以上为源码,修改好之后可以发我的邮箱jsczyx@qq.com 测试可用再追加高分