2017高起专试题及答案:FSO更改文件夹名称

来源:百度文库 编辑:中科新闻网 时间:2024/04/29 22:50:04
<%
randomize
regjm=int(rnd*9998)+1
function RenameFolder(ByVal strFolderPath, ByVal strNewName)
Dim objFileSystem
Set objFileSystem=Server.CreateObject("Scripting.FileSystemObject")
If Instr(1,strFolderPath,":")=-1 Then
strFolderPath=Server.MapPath(strFolderPath)
End If
Dim objFolder
Set objFolder=objFileSystem.GetFolder(strFolderPath)
objFolder.Name=strNewName
Set objFolder=nothing
Set objFileSystem=nothing
End function
Name1=1
Name2=regjm
RenameFolder Server.MapPath(Name1),Name2
%>
===================================================
"Name1="如何获取更改过的文件夹名称?
只要获得根目录下的文件夹名称就可以了.