asp中判断文件是否存在(不是本机上的文件)

it2022-05-09  20

用fso.fileexists只能查询本地文件是否存在,用组件xmlhttp的readyState的方法可以获取远程文件是否存在,返回大于0,表示文件存在,否则,就是不存在。 set XMLHTTP =Server.CreateObject("Microsoft.XMLHTTP") XMLHTTP.open("HEAD"," http://www.test.com/test.htm",false) XMLHTTP.send() if XMLHTTP.status=200 then '文件存在 end if

转载于:https://www.cnblogs.com/nanshouyong326/archive/2008/07/15/1243357.html


最新回复(0)