<%
Function CheckURL(byval A_strUrl)
set XMLHTTP = Server.CreateObject("MSXML2.ServerXMLHTTP")
XMLHTTP.open "HEAD",A_strUrl,false
XMLHTTP.send()
CheckURL=(XMLHTTP.status=200)
set XMLHTTP = nothing
End function%>

<%
Dim imgurl
imgurl="http://www.ehzh.com/p_w_picpaths/txcs8_13.jpg"
if CheckURL(imgurl) then
response.write ("<img SRC='http://www.ehzh.com/p_w_picpaths/txcs08_13.jpg'>")
else
response.write ("<img SRC='http://ads.ehzh.com/adfiles/20090216/20090216153308663.jpg'>")
end if
%>


也可以:

<%
Dim imgurl
imgurl="http://www.ehzh.com/p_w_picpaths/txcs8_13.jpg"
if CheckURL(imgurl) then
response.write ("OK")
else
response.write ("NO")
end if
%>