当前位置: 移动技术网 > IT编程>脚本编程>VBScript > VBS教程:对象-Drives 集合

VBS教程:对象-Drives 集合

2017年12月12日  | 移动技术网IT编程  | 我要评论

绿茵豹,凌驾乾坤,67军士兵在越南前线哗变

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

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网