asp下的一个检测链接是否为真的函数
发布时间:2023-08-25 10:35:48 所属栏目: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=fals
on error resume next
Set xmlHttp = Server.CreateObject("Microsoft.XMLHTTP")
xmlHttp.open "GET",sUrl,false
xmlHttp.send
if xmlHttp.Status <> 200 then
urlChk=fals
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 (编辑:汽车网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
推荐文章
站长推荐