ASP VolumeName 属性
ASP VolumeName 属性用于设置或返回指定驱动器的卷名。
句法:
DriveObject.VolumeName[=newname]
参数:此属性有一个参数,如上所述,如下所述:
- newname:它指定必须为驱动器设置的新名称。它是一个可选参数。
示例:下面的代码演示了 ASP Drive.VolumeName 属性。
ASP
<%
dim fs,d1,d2
set fs=Server.CreateObject("Scripting.FileSystemObject")
'Getting the drive
set d1=fs.GetDrive("D:")
'Getting the name of the drive
Response.Write("The volume name is: " & d1.VolumeName)
'Getting the drive
set d2=fs.GetDrive("F:")
'Getting the name of the drive
Response.Write("
The volume name is: " & d2.VolumeName)
set d1=nothing
set d2=nothing
set fs=nothing
%>
输出:
The volume name is: Windows
The volume name is: Software