加入收藏 | 设为首页 | 会员中心 | 我要投稿 聊城站长网 (https://www.0635zz.com/)- 智能语音交互、行业智能、AI应用、云计算、5G!
当前位置: 首页 > 站长学院 > Asp教程 > 正文

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

发布时间:2023-05-26 13:42:47 所属栏目: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
 
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
 
 

(编辑:聊城站长网)

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

    推荐文章