Asp判断Url是否有效

来源:互联网 发布:linux下载安装 编辑:程序博客网 时间:2024/05/16 14:31
<
url
="http://www.sina.com.cn" 

Function   chku(murl) 
on   error   resume   next 
Set   xmlHttp   =   Server.CreateObject("Microsoft.XMLHTTP"
xmlHttp.open   
"GET",murl,false 
xmlHttp.send 
        
if   xmlHttp.Status   <>   200   then 
                chku
=false 
        
else 
                chku
=true 
        
end   if 
End   Function 

if   chku(url)   then 
        response.write(url
&"(链接正常)"
else 
        response.write(url
&"(掉链、坏链、死链)"
end   if 
%
> 
 http://www.qqgb.com/NetProgramme/ASP/ASPJQ/NetProgramme_164736.html
原创粉丝点击