网站制作学习网ASP→正文:检查是否存在指定的文件
字体:

检查是否存在指定的文件

ASP 2008/1/24 8:08:14  点击:不统计

《%

function JudgeFileExit(strFileName)

Dim objFSO,objFile,objFJ

Dim strFilePath

Dim blFJ

Dim intFlag

intFlag=0

set objFSO=CreateObject("Scripting.FileSystemObject")

strFilePath=server.MapPath("./")

if right(strFilePath,1)<>"/" or right(strFilePath,1)<>"\" then

strFilePath=strFilePath&"\"

end if

blFJ=objFSO.FileExists(strFilePath&strFileName)

do while blFJ=true

intFlag=intFlag+1

blFJ=objFSO.FileExists(strFilePath &intFlag&strFileName)

loop

if intFlag=0 then

JudgeFileExit= strFileName

else

JudgeFileExit=intFlag&strFileName

end if

set objFSO=nothing

end function

Response.Write JudgeFileExit("22.htm")

%>





·上一篇:滚动新闻 >>    ·下一篇:sql判断为空. >>
推荐文章
最新文章