Hello,
I am getting a drives type, (Removable Media, HDD, cd rom), and displaying it to the user.
Works great, but not on SP2, it returns a weird drive type (8975933078237085698)
It should return:
"9222812402616107010" = Check for Removable Media
"9222812402616107011" = Check For HardDisks
"9222812402616107013" = Check for Cd-Roms
But as you can see not even close.
Below is the code, anyone know why this is an issue????????
I am getting a drives type, (Removable Media, HDD, cd rom), and displaying it to the user.
Works great, but not on SP2, it returns a weird drive type (8975933078237085698)
It should return:
"9222812402616107010" = Check for Removable Media
"9222812402616107011" = Check For HardDisks
"9222812402616107013" = Check for Cd-Roms
But as you can see not even close.
Below is the code, anyone know why this is an issue????????
Code:
Public Declare Function GetDriveType Lib "kernel32" Alias "GetDriveTypeA" (ByVal nDrive As String) As Long
Dim strDrives As String() = Environment.GetLogicalDrives()
Dim drive As String
For Each drive In strDrives
Dim strType As String = GetDriveType(drive)
Dim driveSTR As String = "Unknown Type : "
TextBox1.Text &= (drive & " is type : ")
Select Case strType
Case "9222812402616107010"
Check for Removable Media
driveSTR = "Removable Media"
Case "9222812402616107011"
Check For HardDisks
driveSTR = "Hard Disc"
Case "9222812402616107013"
Check for Cd-Roms
driveSTR = "CD-ROM"
Case Else
driveSTR &= strType
End Select
TextBox1.Text &= driveSTR & vbCrLf
Next