判断远程图片是否存在?
使用以下代码,当网站设置了404错误页面的时候,图片判断就失败,明明不存在的图片,会被认为存在,如何改成能判断404??
<%
function CheckURL(byval A_strUrl)
Set XMLHTTP = Server.CreateObject("MSXML2.ServerXMLHTTP.3.0")
xmlhttp.open "HEAD",A_strUrl, false
XMLHTTP.send()
CheckURL=XMLHTTP.status=200
set XMLHTTP = nothing
end function
Dim imgurl
imgurl="http://163.com/UploadF8iles/2007829144940734.gif"
if CheckURL(imgurl) then
response.write "图片存在"
else
response.write "图片不存在"
end if
%>