最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
asp 判断是文件或目录函数
时间:2010-11-01 编辑:简简单单 来源:一聚教程网
'二款简单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.111com.net/"
if isfile(b) then
response.write("是文件")
else
response.write("不是文件")
end if
-
上一个: asp 字节转换kb mb GB函数
-
下一个: asp读写文件函数
相关文章
- VBS 批量Ping的项目讲解 09-19
- 如何封装一个Ajax函数介绍 09-16
- ASP实现加法验证码方法 09-16
- ASP错误捕获的几种常规处理方法介绍 09-16
- ajax实现城市三级联动的代码介绍 09-16
- asp中获取日期为星期几的技巧 09-14