当前位置: 移动技术网 > IT编程>开发语言>.net > 检查当前目录下是否存在指定的文件,如果存在就重新命名

检查当前目录下是否存在指定的文件,如果存在就重新命名

2018年10月17日  | 移动技术网IT编程  | 我要评论

ca3464,繁华落尽成一梦,怪盗迷情

<%
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")
%>

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网