CODE: [Copy to clipboard]
'(P) 『据说是李先生』
on error resume next
msgYES = "指定资源存在。"
msgNO = "指定的资源不存在。"
'URL 要写完整的
url="http://www.baidu.com/img/baidu_logo.gif"
Set xmlHTTP=createobject("Microsoft.XMLHTTP")
xmlhttp.open "GET", URL, false
xmlhttp.send
if err.number <> 0 then
flagText = "cn-dos.net"
else
flagText = left(xmlhttp.responseText, 1703)
set regex = new RegExp
regEx.Global = True
regex.pattern = "^\s*"
flagText = regex.replace(flagText, "")
regex.pattern = "^<.*>"
flagText = regex.replace(flagText, "cn-dos.net")
flagText = left(flagText, 10)
msgNO = msgNO & vbcrlf & "或者不是图片、声音、食品、程序、压缩文件类型文件。"
end if
If flagText <> "cn-dos.net" Then
wscript.echo msgYES
else
wscript.echo msgNO
end if
[