asp中的一个检测链接是否正常的函数
发布时间:2023-05-25 13:25:02 所属栏目:Asp教程 来源:
导读:很简单的函数,用来检测网站域名是否能正常访问。
Function urlChk(sUrl)
on error resume next
Set xmlHttp = Server.CreateObject("Microsoft.XMLHTTP")
xmlHttp.open "GET",sUrl,false
xmlHt
Function urlChk(sUrl)
on error resume next
Set xmlHttp = Server.CreateObject("Microsoft.XMLHTTP")
xmlHttp.open "GET",sUrl,false
xmlHt
很简单的函数,用来检测网站域名是否能正常访问。 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="http://www.cuoxin.com" if urlChk(sUrl) then response.write(sUrl&"(可以正常访问)") else response.write(sUrl&"(访问不了)") end if (编辑:聊城站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
推荐文章
站长推荐