加入收藏 | 设为首页 | 会员中心 | 我要投稿 银川站长网 (https://www.0951zz.com/)- 云通信、基础存储、云上网络、机器学习、视觉智能!
当前位置: 首页 > 站长学院 > Asp教程 > 正文

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

发布时间:2023-07-20 13:20:25 所属栏目:Asp教程 来源:
导读:asp下的一个检测链接是不是正常的函数:Function urlChk(sUrl)on error resume nextSet xmlHttp = Server.CreateObject("Microsoft.XMLHTTP")xmlHttp.open "GET",sUrl,falsexmlHttp.send if xmlHttp.Status <> 20

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="//www.Cuoxin.com"

if urlChk(sUrl) then

    response.write(sUrl&"(可以正常访问)")

else

    response.write(sUrl&"(访问不了)")

end if

(编辑:银川站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章