drives 集合
只读所有可用驱动器的集合。
说明
无论是否插入媒体,可移动媒体驱动器都显示在 drives 集合中。
以下代码举例说明如何获得 drives 集合并使用 for each...next 语句枚举集合成员:
showdrivelist 函数 dim fso, d, dc, s, n set fso = createobject("scripting.filesystemobject") set dc = fso.drives for each d in dc n = "" s = s & d.driveletter & " - " if d.drivetype = remote then n = d.sharename elseif d.isready then n = d.volumename end if s = s & n &"<br>" next showdrivelist = send function