并不是分区的序列号哦,或者其它硬件的序列号也可以,如CPU、主板。只要能解决问题,再加100分!

解决方案 »

  1.   

    有取硬盘硬件序列号的DLL文件,你去网上找一下就可以。
      

  2.   

    http://expert.csdn.net/Expert/topic/2849/2849314.xml?temp=.4745294
      

  3.   

    http://expert.csdn.net/Expert/topic/2253/2253377.xml?temp=.5469324
      

  4.   

    http://www.easthot.net/dl_info.asp?id=101
    东方热讯
    从RING3获取硬盘序列号
      

  5.   

    Private Declare Function GetVolumeInformation& Lib "kernel32" _
     Alias "GetVolumeInformationA" (ByVal lpRootPathName As String, _
     ByVal pVolumeNameBuffer As String, ByVal nVolumeNameSize As Long, _
     lpVolumeSerialNumber As Long, lpMaximumComponentLength As Long, _
     lpFileSystemFlags As Long, ByVal lpFileSystemNameBuffer As String, _
     ByVal nFileSystemNameSize As Long)
    Private Const MAX_FILENAME_LEN = 256
    Public Function DriveSerial(ByVal sDrv As String) As Long
    'Usage:
    'Dim ds As Long
    'ds = DriveSerial("C")
     Dim RetVal As Long
     Dim str As String * MAX_FILENAME_LEN
     Dim str2 As String * MAX_FILENAME_LEN
     Dim a As Long
     Dim b As Long
     GetVolumeInformation sDrv & ":\", str, MAX_FILENAME_LEN, RetVal, _
     a, b, str2, MAX_FILENAME_LEN
     DriveSerial = RetVal
    End Function
         
      如果需要某个磁盘的序列号的话,只要DriveSerial(该磁盘的盘符)即可。
      

  6.   

    http://www.dapha.net/club/dispbbs.asp?boardID=1&replyID=42462&ID=30704&skin=1
    取得主板序列号的动态连接库及示例代码
      

  7.   

    何获取硬盘卷标、序列号和文件系统类型?
     
         磁盘序列号在每次软盘或硬盘格式化后都重新生成,并且不回重复。许多程序员用此加密。其实也可以修改该函数,可以得到磁盘卷标和文件系统类型信息。声明:
    Private Declare Function GetVolumeInformation Lib "kernel32.dll" Alias _
      "GetVolumeInformationA" (ByVal lpRootPathName As String, ByVal _
      lpVolumeNameBuffer As String, ByVal nVolumeNameSize As Integer, _
      lpVolumeSerialNumber As Long, lpMaximumComponentLength As Long, _
      lpFileSystemFlags As Long, ByVal lpFileSystemNameBuffer As String, _
      ByVal nFileSystemNameSize As Long) As Long代码:Function GetSerialNumber(sRoot As String) As Long
      Dim lSerialNum As Long
      Dim R As Long
      Dim strLabel As String, strType As String
      strLabel = String$(255, Chr$(0))
      '磁盘卷标
      strType = String$(255, Chr$(0))
      '文件系统类型 一般为 FAT 
      R = GetVolumeInformation(sRoot, strLabel, Len(strLabel), _
        lSerialNum, 0, 0, strType, Len(strType))
      GetSerialNumber = lSerialNum
      '在 strLabel 中为 磁盘卷标
      '在 strType 中为 文件系统类型
    End Function用法:当驱动器不存在时,函数返回 0。如果是个非根目录,也将返回 0:lSerial = GetSerialNumber("c:\")
     
      

  8.   

    'Getcpuid.dll 获取的id只有8位,下面简短的代码返回的是16位16进制的字符串。'必须引用 Microsoft WMI Scripting Library
    Sub wmiProcessorID()   Dim cpuSet As SWbemObjectSet
       Dim cpu As SWbemObject
      
       Set cpuSet = GetObject("winmgmts:{impersonationLevel=impersonate}"). _
                               InstancesOf("Win32_Processor")
       For Each cpu In cpuSet
          MsgBox cpu.ProcessorId
       Next
    End Sub
    网上的代码
    我的cpu是AthlonXP2000+    0383FBFF00000681序列号
    各位测试一下看看!