API call for hdd firmware

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Stevecb
    New Member
    • Jul 2010
    • 13

    API call for hdd firmware

    Hello
    This code works nicely for some of the hard disk specs but it doesn't cover getting the firmware of the drive. Does anyone know how to get that?...
    Code:
    Private Sub btnGetDriveType_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGetDriveType.Click
            Dim rootPathName As String
            rootPathName = txtDriveLetter.Text & ":" & Path.DirectorySeparatorChar
    
            Select Case Win32API.GetDriveType(rootPathName)
                Case 2
                    txtFunctionOutput.Text = "Drive type: Removable"
                Case 3
                    txtFunctionOutput.Text = "Drive type: Fixed"
                Case Is = 4
                    txtFunctionOutput.Text = "Drive type: Remote"
                Case Is = 5
                    txtFunctionOutput.Text = "Drive type: Cd-Rom"
                Case Is = 6
                    txtFunctionOutput.Text = "Drive type: Ram disk"
                Case Else
                    txtFunctionOutput.Text = "Drive type: Unrecognized"
            End Select
        End Sub
    I'm using VS 2008
    thanks, Steve
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    Instead of using the Win32API I recommend that you check out the DrivInfo class which is part of the System.IO namespace. I don't know if it will give you the firmware version but at least it's managed code :)

    -Frinny

    Comment

    Working...