最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
给大家帖个函数!检查当前目录下是否存在指定的文件,如果存在就重新命名。
时间:2022-07-03 00:00:06 编辑:袖梨 来源:一聚教程网
<%
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")
%>
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")
%>
相关文章
- Solana因伊朗-以色列动荡遭受重创——SOL价格会持续下跌吗? 06-16
- 《雷霆战机集结》Boss模式关卡刷取建议 06-16
- 《世界启元》S6赛季芝诺周瑜队搭配攻略 06-16
- 《世界启元》S6赛季新英雄达尔文技能分析及配队推荐 06-16
- 《纸嫁衣3鸳鸯债》全章节超详细攻略 06-16
- 杠杆、流动性与多头:无人预见的山寨币反弹格局 06-16