Name 属性用来设置或返回指定的文件或文件夹的名称。
FileObject.Name[=newname] FolderObject.Name[=newname]
参数 | 描述 |
---|---|
newname | 可选的。规定文件或文件夹的名称。 |
<%
dim fs,f
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.GetFile("c:\help.txt")
Response.Write("The file's name: ")
Response.Write(f.Name
)
set f=nothing
set fs=nothing
%>
输出:
The file's name: help.txt
<%
dim fs,fo
set fs=Server.CreateObject("Scripting.FileSystemObject")
set fo=fs.GetFolder("c:\help")
Response.Write("The folder's name: ")
Response.Write(fo.Name
)
set fo=nothing
set fs=nothing
%>
输出:
The folder's name: help