asp下的一个检测链接是否正常的函数
asp下的一个检测链接是否正常的函数
发布时间:2016-12-29 来源:查字典编辑
摘要:FunctionurlChk(sUrl)onerrorresumenextSetxmlHttp=Server.CreateObject("M...

FunctionurlChk(sUrl)

onerrorresumenext

SetxmlHttp=Server.CreateObject("Microsoft.XMLHTTP")

xmlHttp.open"GET",sUrl,false

xmlHttp.send

ifxmlHttp.Status<>200then

urlChk=false

else

urlChk=true

endif

EndFunction

sUrl="http://www.jb51.net"

ifurlChk(sUrl)then

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

else

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

endif

推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
相关阅读
网友关注
最新ASP教程学习
热门ASP教程学习
编程开发子分类