首页 > 编程 > ASP > 正文

asp下的一个检测链接是否正常的函数

2020-07-27 12:59:01
字体:
来源:转载
供稿:网友
Function urlChk(sUrl)
on error resume next
Set xmlHttp = Server.CreateObject("Microsoft.XMLHTTP")
xmlHttp.open "GET",sUrl,false
xmlHttp.send
    if xmlHttp.Status <> 200 then
        urlChk=false
    else
        urlChk=true
    end if
End Function

sUrl="https://www.VeVB.COm"
if urlChk(sUrl) then
    response.write(sUrl&"(可以正常访问)")
else
    response.write(sUrl&"(访问不了)")
end if
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表