fso Name主要是用来取得文件或文件夹名称
Name属性是用来设置或返回的名称指定的文件或文件夹。
语法
FileObject.Name [ = newname ]
FolderObject.Name [ = newname ]
参数说明
newname 可选。指定名称 的文件或文件夹
例如File对象
<%
dim fs,f
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.GetFile("c:test.txt")
Response.Write("The file's name: ")
Response.Write(f.Name)
set f=nothing
set fs=nothing
%>
Output:
The file's name: test.txt
对获取文件夹实例教程.
<%
dim fs,fo
set fs=Server.CreateObject("Scripting.FileSystemObject")
set fo=fs.GetFolder("c:test")
Response.Write("The folder's name: ")
Response.Write(fo.Name)
set fo=nothing
set fs=nothing
%>
Output:
The folder's name: test
时间: 2024-11-02 18:55:29