首页 > Web开发 > 详细

VBS教程:对象-Drives 集合

时间:2016-02-06 20:32:29      阅读:238      评论:0      收藏:0      [点我收藏+]

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

VBS教程:对象-Drives 集合

原文:http://www.jb51.net/article/4451.htm

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!