当前位置:主页 > 软件编程 > ASP代码 >

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

时间:2021-06-28 08:26:31 | 栏目:ASP代码 | 点击:

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.jb51.net"
if urlChk(sUrl) then
    response.write(sUrl&"(可以正常访问)")
else
    response.write(sUrl&"(访问不了)")
end if

您可能感兴趣的文章:

相关文章