PUSH  EBX
PUSH  EDI
                  MOV   EDI,EAX
MOV   EAX,0
DW    $A20F
                  MOV   EAX,EBX
XCHG  EBX,ECX
MOV   ECX,4 @1:
STOSB
SHR   EAX,8
LOOP  @1 MOV   EAX,EDX
MOV   ECX,4 @2:
STOSB
SHR   EAX,8
LOOP  @2 MOV   EAX,EBX
MOV   ECX,4 @3:
STOSB
SHR   EAX,8
LOOP  @3 POP   EDI
POP   EBX
这是获得CPU厂商的代码

解决方案 »

  1.   

    是不是每台机器上的cpu号+硬盘号都不同,即全球唯一
      

  2.   

    PUSH  EBX
    PUSH  EDI
    MOV  EDI,EAX
    MOV  EAX,1
    DW  $A20F
    STOSD
    MOV EAX,EBX
    STOSD
    MOV  EAX,ECX
    STOSD
    MOV EAX,EDX
    STOSD
    POP EDI
    POP  EBX
    这是获得CPU类型的代码
      

  3.   

    呵呵,汇编都上来了啊。我知道c是可以实现的。不知道vb有没有类似的函数什么的。应该用vb也可以实现啊。
      

  4.   

    我只会这样了。希望对你有帮助。 
    On Error GoTo SysInfoErr
            Dim rc As Long
            Dim SysInfoPath As String
            ' 从注册表获得系统信息程序路径\名称...
            If GetKeyValue(HKEY_LOCAL_MACHINE, gREGKEYSYSINFO, gREGVALSYSINFO, SysInfoPath) Then
            ' 仅从注册表获得系统信息程序路径...
            ElseIf GetKeyValue(HKEY_LOCAL_MACHINE, gREGKEYSYSINFOLOC, gREGVALSYSINFOLOC, SysInfoPath) Then
                    ' 验证已知的 32 位文件版本的存在
                    If (Dir(SysInfoPath & "\MSINFO32.EXE") <> "") Then
                            SysInfoPath = SysInfoPath & "\MSINFO32.EXE"
                    ' 错误 - 文件找不到...
                    Else
                            GoTo SysInfoErr
                    End If
            ' 错误 - 注册表项找不到...
            Else
                    GoTo SysInfoErr
            End If
            Call Shell(SysInfoPath, vbNormalFocus)
            Exit Sub
    SysInfoErr:
            MsgBox "此时系统信息不可用", vbOKOnly
      

  5.   

    硬盘信息:
    Option Explicit
    ' Distribution: You can freely use this code in your own
    '               applications, but you can not publish
    '               or reproduce this code on any web site,
    '               on any online service, or distribute on
    '               any media without express permission.
    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    '/* used for listview column auto-resizing
    Private Const LVM_FIRST As Long = &H1000
    Private Const LVM_SETCOLUMNWIDTH As Long = (LVM_FIRST + 30)
    Private Const LVSCW_AUTOSIZE As Long = -1
    Private Const LVSCW_AUTOSIZE_USEHEADER As Long = -2Private Declare Function SendMessage Lib "user32" _
       Alias "SendMessageA" _
      (ByVal hwnd As Long, _
       ByVal wMsg As Long, _
       ByVal wParam As Long, _
       lParam As Any) As Long
    Private Sub Form_Load()   With ListView1
          .ListItems.Clear
          .ColumnHeaders.Clear
          .View = lvwReport
          .Sorted = False
       End With
       
       Command1.Caption = "Disk Info"End Sub
    Private Sub Command1_Click()   ListView1.ListItems.Clear
       Call wmiDiskDriveInfo
       Call lvAutosizeControl(ListView1)
       
    End Sub
    Private Sub lvAutosizeControl(lv As ListView)   Dim col2adjust As Long  '/* Size each column based on the maximum of
      '/* EITHER the columnheader text width, or,
      '/* if the items below it are wider, the
      '/* widest list item in the column
       For col2adjust = 0 To lv.ColumnHeaders.Count - 1
       
          Call SendMessage(lv.hwnd, _
                           LVM_SETCOLUMNWIDTH, _
                           col2adjust, _
                           ByVal LVSCW_AUTOSIZE_USEHEADER)   Next
       
    End Sub
    Private Sub wmiDiskDriveInfo()   Dim DiskDriveSet As SWbemObjectSet
       Dim dd As SWbemObject
       Dim thiscol As Long
       Dim capcount As Long
       Dim msg As String
       Dim sflag As String  'used in err trap
       Dim itmx As ListItem   On Local Error GoTo diskinfo_error
       
      'add a first column, and set lv initial parameters
       With ListView1
          .ListItems.Clear
          .View = lvwReport
          .Sorted = False
          .ColumnHeaders.Clear
          .ColumnHeaders.Add , , "WMI Property"
          
          'add class properties to column 1
          'identification info
          .ListItems.Add , , "ID: Description"
          .ListItems.Add , , "ID: Index"
          .ListItems.Add , , "ID: DeviceID"
          .ListItems.Add , , "ID: Caption"
          .ListItems.Add , , "ID: Manufacturer"
          .ListItems.Add , , "ID: Model"
          .ListItems.Add , , "ID: InterfaceType"
          .ListItems.Add , , "ID: MediaLoaded"
          .ListItems.Add , , "ID: MediaType"
          
          'physical info
          .ListItems.Add , , "Phyical: Status"
          .ListItems.Add , , "Phyical: Size"
          .ListItems.Add , , "Phyical: Partitions"
          .ListItems.Add , , "Phyical: BytesPerSector"
          .ListItems.Add , , "Phyical: SectorsPerTrack"
          .ListItems.Add , , "Phyical: TotalCylinders"
          .ListItems.Add , , "Phyical: TotalHeads"
          .ListItems.Add , , "Phyical: TotalTracks"
          .ListItems.Add , , "Phyical: TracksPerCylinder"
          
          'capabilities of the device
          .ListItems.Add , , "Disk Capabilities:"
       End With   Set DiskDriveSet = GetObject("winmgmts:{impersonationLevel=impersonate}"). _
                                               InstancesOf("Win32_DiskDrive")
           
      'for each drive, fill in respective columns
       For Each dd In DiskDriveSet
       
          With ListView1
             .ColumnHeaders.Add , , dd.Description & " " & dd.Index
             capcount = 0
             thiscol = (.ColumnHeaders.Count - 1)
             
             'add identification info
             .ListItems(1).SubItems(thiscol) = dd.Description
             .ListItems(2).SubItems(thiscol) = dd.Index
             .ListItems(3).SubItems(thiscol) = dd.DeviceID
             .ListItems(4).SubItems(thiscol) = dd.Caption
             .ListItems(5).SubItems(thiscol) = dd.Manufacturer
             .ListItems(6).SubItems(thiscol) = dd.Model
             .ListItems(7).SubItems(thiscol) = dd.InterfaceType
             .ListItems(8).SubItems(thiscol) = dd.MediaLoaded
             .ListItems(9).SubItems(thiscol) = dd.MediaType         'add physical info
             .ListItems(10).SubItems(thiscol) = dd.Status
             .ListItems(11).SubItems(thiscol) = FormatNumber(dd.Size, 0)
             .ListItems(12).SubItems(thiscol) = dd.Partitions
             .ListItems(13).SubItems(thiscol) = FormatNumber(dd.BytesPerSector, 0)
             .ListItems(14).SubItems(thiscol) = FormatNumber(dd.SectorsPerTrack, 0)
             .ListItems(15).SubItems(thiscol) = FormatNumber(dd.TotalCylinders, 0)
             
             'note: the value for the TotalHeads property
             'is obtained through extended functions of
             'BIOS interrupt 13h. The value may be inaccurate
             'if the drive uses a translation scheme to
             'support high capacity disk sizes. Consult
             'the manufacturer for accurate drive
             'specifications
             .ListItems(16).SubItems(thiscol) = FormatNumber(dd.TotalHeads, 0)
             .ListItems(17).SubItems(thiscol) = FormatNumber(dd.TotalTracks, 0)
             .ListItems(18).SubItems(thiscol) = FormatNumber(dd.TracksPerCylinder, 0)
          
            'capabilities of the device
             
            'because different drives may have different
            'capabilites, the routine is coded such that
            'when an insertion is attempted against a
            'non-existant subitem index, the error trap
            'will add the additional row. The sflag
            'just assists in identifying the error
            'occured because of the capactities loop.
             sflag = "caploop"
             For capcount = LBound(dd.capabilities) To UBound(dd.capabilities)            Select Case dd.capabilities(capcount)
                   Case 0: msg = "Unknown "
                   Case 1: msg = "Other "
                   Case 2: msg = "Sequential Access "
                   Case 3: msg = "Random Access "
                   Case 4: msg = "Supports Writing "
                   Case 5: msg = "Encryption "
                   Case 6: msg = "Compression "
                   Case 7: msg = "Supports Removable Media "
                   Case 8: msg = "Manual Cleaning "
                   Case 9: msg = "Automatic Cleaning "
                   Case 10: msg = "SMART Notification "
                   Case 11: msg = "Supports Dual Sided Media "
                   Case 12: msg = "Ejection Prior to Drive Dismount Not Required"
                
                End Select
                
                .ListItems(19 + capcount).SubItems(thiscol) = msg
            
             Next
             sflag = ""
          
          End With
          
       Next
       
    diskinfo_exit:   On Local Error GoTo 0
       Exit Sub
       
    diskinfo_error:  'if "index out of bounds" error
      'and error occurred as result of
      'adding drive capabilities, add
      'a new blank listitem and resume
       If Err.Number = 35600 And sflag = "caploop" Then
          ListView1.ListItems.Add 19 + capcount, , ""
          Resume
       Else
          Resume Next
       End If
    '--end block--'
    End Sub
      

  6.   

    呵呵,WMI的。
    http://nowcan.k666.com