📜  ASP FileSystem.Drives 属性

📅  最后修改于: 2022-05-13 01:56:51.030000             🧑  作者: Mango

ASP FileSystem.Drives 属性

FileSystem.Drives属性用于返回系统上存在的所有 Drive 对象的只读集合。单个驱动元件可以通过循环来获得它们的属性。

句法:

FileSystemObject.Drives

示例:下面的代码说明了如何显示系统上存在的所有驱动器号。

ASP
<%
dim fs,fo,x
set fs=Server.CreateObject("Scripting.FileSystemObject")
  
'Get all the drives on the system
set fo=fs.Drives
  
Response.write("The drives present are:")
for each x in fo
  'Print the name of all drives on system
  Response.write("
Drive: " & x.DriveLetter) next    set fo=nothing set fs=nothing %>


输出:

The drives present are:
Drive: C
Drive: D
Drive: E
Drive: F