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.jb51.net" 
if urlChk(sUrl) then 
    response.write(sUrl&"(可以正常访问)") 
else 
    response.write(sUrl&"(访问不了)") 
end if 
                        
                        
      
      
    asp下的一个检测链接是否正常的函数
内容版权声明:除非注明,否则皆为本站原创文章。
