谁有windows7下获取硬盘物理序列号的VB代码
Option Explicit
'纯vb的获取硬盘序列号代码 (摘自枕善居)
'窗体放置1个ComBox,定名为cbDrive,1个ListBox,定名为lstMain,一个CommandButton,定名为cmdGo,添加如下代码
Dim h As clsMainInfo
Private Sub cmdGo_Click()
Dim hT As Long
Dim uW() As Byte
Dim dW() As Byte
Dim pW() As Byte
Set h = New clsMainInfo
With h
CurrentDrive = Val(cbDrive。Text)
lstMain。Clear
lstMain。AddItem "当前驱动器: " & 。CurrentDrive
lstMain。
AddItem ""
lstMain。AddItem "硬盘型号: " & 。GetModelNumber
lstMain。AddItem "序列号: " & 。GetSerialNumber
lstMain。
AddItem "固件版本: " & 。GetFirmwareRevision
End With
Set h = Nothing
End Sub
Private Sub Form_Load()
cbDrive。
AddItem 0
cbDrive。AddItem 1
cbDrive。AddItem 2
cbDrive。AddItem 3
cbDrive。ListIndex = 0
End Sub
以上代码你碰运气,别的,我别的又发了一段代码到你的邮箱,你看一下,希望对你有所帮忙。