用api得到你想要的,搜一下有很多,举例如何取得磁盘序列号? Declare Function GetVolumeInformation Lib "kernel32" _ Alias "GetVolumeInformationA" _ (ByVal lpRootPathName As String, _ ByVal lpVolumeNameBuffer As String, _ ByVal nVolumeNameSize As Long, _ lpVolumeSerialNumber As Long, _ lpMaximumComponentLength As Long, _ lpFileSystemFlags As Long, _ ByVal lpFileSystemNameBuffer As String, _ ByVal nFileSystemNameSize As Long) As Long程序:Private Sub Form_Load() Dim sDriveLetter As String Dim RetVal As Long Dim lpName As String Dim nSize As Long Dim nSerial As Long Dim lpMaxComp As Long Dim nFileFlags As Long Dim lpFileName As String lpName = Space(255) lpFileName = Space(255) nSize = 255 sDriveLetter = "c:\" ’这里你可以指定任何盘号 RetVal = GetVolumeInformation(sDriveLetter, lpName, _ nSize, nSerial, lpMaxComp, nFileFlags, lpFileName, nSize) '你可以看出,不仅能得到序列号,还可以得到其他很多信息 If RetVal = 0 Then '这里是你的错误处理代码 Exit Sub 'Quit the subroutine Else lblDriveSerial.Caption = CStr(nSerial) '假定你已经建立了这个标签,将在标签上显示序列号. End If End Sub
Declare Function GetVolumeInformation Lib "kernel32" _
Alias "GetVolumeInformationA" _
(ByVal lpRootPathName As String, _
ByVal lpVolumeNameBuffer As String, _
ByVal nVolumeNameSize As Long, _
lpVolumeSerialNumber As Long, _
lpMaximumComponentLength As Long, _
lpFileSystemFlags As Long, _
ByVal lpFileSystemNameBuffer As String, _
ByVal nFileSystemNameSize As Long) As Long程序:Private Sub Form_Load()
Dim sDriveLetter As String
Dim RetVal As Long
Dim lpName As String
Dim nSize As Long
Dim nSerial As Long
Dim lpMaxComp As Long
Dim nFileFlags As Long
Dim lpFileName As String
lpName = Space(255)
lpFileName = Space(255)
nSize = 255 sDriveLetter = "c:\" ’这里你可以指定任何盘号 RetVal = GetVolumeInformation(sDriveLetter, lpName, _
nSize, nSerial, lpMaxComp, nFileFlags, lpFileName, nSize)
'你可以看出,不仅能得到序列号,还可以得到其他很多信息 If RetVal = 0 Then
'这里是你的错误处理代码
Exit Sub 'Quit the subroutine
Else
lblDriveSerial.Caption = CStr(nSerial)
'假定你已经建立了这个标签,将在标签上显示序列号.
End If
End Sub
VC++读取内存SPD信息
http://blog.csdn.net/liwu_111/archive/2008/04/09/2269554.aspx
http://www.applevb.com/sourcecode/wmi.rar
其他在当时需求中不要求。。
Set mem = wmi.instancesof("win32_physicalmemory")
'msg=msg&"内存容量:"+Chr(13)
For Each m In mem
Debug.Print m.Tag
Debug.Print vbTab & "banklabel" & vbTab; m.banklabel
Debug.Print vbTab & "Capacity" & vbTab; m.Capacity
Debug.Print vbTab & "DataWidth" & vbTab; m.DataWidth
Debug.Print vbTab & "DeviceLocator" & vbTab; m.DeviceLocator
Debug.Print vbTab & "Speed" & vbTab; m.Speed
Debug.Print vbTab & "SerialNumber" & vbTab; m.SerialNumber
Debug.Print vbTab & "InstallDate" & vbTab; m.InstallDate
Debug.Print vbTab & "TypeDetail" & vbTab; m.TypeDetail
Next