|
想请问各位前辈drives集合的count属性和ITEM属性的实际应用。麻烦看下下面函数:
Function ShowDriveList()
Dim fso, d, dc, s, n
Set fso = CreateObject("Scripting.FileSystemObject")
Set dc = fso.Drives
msgbox dc.count
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 = s
End Function
call ShowDriveList()
msgbox ShowDriveList
1)我的电脑上有4个盘,执行时msgbox dc.count,弹出两次对话框,都显示的是4,请教前辈们为什么会出现两次?
2)ITEM属性在我这段代码中怎么应用?
请大侠们给指点下。谢谢。 |
|