【www.gdgbn.com--php函数】
"二款简单asp来判断文件存或目录存在的函数,在asp中这样做只要用到filesystemobject就ok了。
function isdir(givepath)
dim realpath,path,num,fs,i
set fs = createobject("scripting.filesystemobject")
path=givepath
if fs.folderexists(path)=true then
isdir=true
else
isdir=false
"fs.createfolder(realpath)
end if
set fs=nothing
end function
function isfile(fpath)
dim fs
set fs = createobject("scripting.filesystemobject")
if fs.fileexists(fpath)=false then
isfile=false
else
isfile=true
end if
set fs=nothing
end function
dim d="a"
if isdir(a) then
response.write("是目录")
else
response.write("不是目录")
end if
dim b="www.111cn.net/"
if isfile(b) then
response.write("是文件")
else
response.write("不是文件")
end if