Nope...
did this to test
Private Declare Auto Function GetDriveType Lib "kernel32" Alias
"GetDriveTypeA" (ByVal nDrive As String) As Int32
Then my own enums.
Private Enum DriveTypes 'used with GetDriveType
Unknown = 0
Invalid_or_Not_Mounted=1 'invalid path: eg no volume mounted
Removable = 2
Fixed = 3
Remote = 4 'network
CDROM = 5
RAMDisk = 6
End Enum
Then in form_load, this quick testing code
Private Sub frmRestore_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim s As String = "a"
While s <> String.Empty
s = InputBox("Drive?", "prompt")
Dim iDriveType = GetDriveType(s)
'decide type of drive and display appropriate drive letter.
Select Case iDriveType
Case DriveTypes.CDROM
MsgBox("CD")
Case DriveTypes.Fixed
MsgBox("harddrive")
Case DriveTypes.Remote
MsgBox("network")
Case DriveTypes.Removable
If Char.ToUpper(s.Chars(0)) = "A" Or
Char.ToUpper(s.Chars(0)) = "B" Then 'ASSUME FLOPPY
MsgBox("floppy")
Else
MsgBox("zip")
End If
Case DriveTypes.RAMDisk
msgbox("ramdisk")
Case Else
MsgBox("other")
End Select
End While
End
End Sub
iDriveType is always 1 no matter what
A
A:\
A:
C
C:
C:\
doesn't work.
What am I doing wrong?
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:bu************@ID-208219.news.uni-berlin.de...
* "SStory" <Th*******@TAKEOUTTHISSPAMBUSTERsofthome.net> scripsit: oddly enough I try this with INPUTBOX to test and keeps returning 1
no matter if I put in C:\
A:\
F:\
or whatever as the input string.
Is there a bug still?
Remove the backslash and try again.
--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>