首页 » ASP代码 » asp检测域名是否可以打开的函数

asp检测域名是否可以打开的函数

Function urlChk(sUrl)
on error resume next
Set xmlHttp = Server.CreateObject("Microsoft.XMLHTTP")
xmlHttp.open "GET",sUrl,false
xmlHttp.send
urlChk= false
if xmlHttp.Status = 200 then urlChk= true
set xmlHttp=nothing
End Function
'使用方法
sUrl="http://www.suntw.com"
if urlChk(sUrl) then response.write("正常") else response.write("打不开")

, , ,

转发到新浪微博 转发到新浪微博

目前这篇文章有175条评论(Rss)

我要评论