判断远程图片是否存在的ASP技巧

函数:

Function CheckURL(byval A_strUrl)
set XMLHTTP = Server.CreateObject("Microsoft.XMLHTTP")
XMLHTTP.open "HEAD",A_strUrl,false
XMLHTTP.send()
CheckURL=(XMLHTTP.status=200)
set XMLHTTP = nothing
End function

 

调用:

Dim imgurl
imgurl="http://www.abc.com/UploadFiles/2007829144940734.gif"
if CheckURL(imgurl) then
response.write "图片存在"
else
response.write "图片不存在"
end if

posted @ 2008-10-24 13:34  missthe  阅读(325)  评论(0编辑  收藏  举报