how can i know the number of units in a computer ( e.g. c:\,g:\, ecc)
using ONLY the api?
Printable View
how can i know the number of units in a computer ( e.g. c:\,g:\, ecc)
using ONLY the api?
Code:Dim LDs As Long, Cnt As Long, sDrives As String
'get the available drives
LDs = GetLogicalDrives
sDrives = "Available drives:"
For Cnt = 0 To 25
If (LDs And 2 ^ Cnt) <> 0 Then
sDrives = sDrives + " " + Chr$(65 + Cnt)
End If
Next Cnt
form1.caption = sDrives
You will also need this
Code:Declare Function GetLogicalDrives Lib "kernel32" Alias "GetLogicalDrives" () As Long