October 8, 2004 – 2:32 pm
Is there a way that I can return all available local drive letters ? Yes, there is a way !
1
| Declare Function GetLogicalDriveStrings Lib "kernel32" Alias "GetLogicalDriveStringsA" (Byval nBufferLength As Long, Byval lpBuffer As String) As Long |
1
2
3
4
5
6
7
8
9
10
11
12
13
| Function GetDrives() As String
Dim tmp As String
Dim iCount As Integer
Dim strDrives As String
strDrives = Space$(64)
Call GetLogicalDriveStrings(Len(strDrives), strDrives)
For iCount = 1 To Len(strDrives) Step 4
tmp = tmp & " " + Mid$(strDrives, iCount, 1)
Next iCount
GetDrives = Trim(tmp)
End Function |
1
2
3
| Sub Click(Source As Button)
Msgbox getdrives
End Sub |
Posted in Source Code |
Sorry, comments for this entry are closed at this time.