次のコードを使用して、コンピューターの各ドライブの文字のリストを取得しています。このリストから CD ドライブのドライブ文字を取得したいと考えています。どうすれば確認できますか?
リストを取得するために使用しているコードは次のとおりです。
Form.Load
イベントでは:
cmbDrives.DropDownStyle = ComboBoxStyle.DropDownList
Dim sDrive As String, sDrives() As String
sDrives = ListAllDrives()
For Each sDrive In sDrives
Next
cmbDrives.Items.AddRange(ListAllDrives())
. . .
Public Function ListAllDrives() As String()
Dim arDrives() As String
arDrives = IO.Directory.GetLogicalDrives()
Return arDrives
End Function