主  题:取得硬盘出厂ID的DLL,谁要?留下E-MAIL(内有广告,三日内给分)
作  者:dbcontrols
所属论坛:Visual Basic
问题点数:142
回复次数:84
发表时间:2001-12-11 9:48:15
 
  
  最新消息:
http://www.wzjcw.net/vbgood/taishan/index.html 

解决方案 »

  1.   

    To xxlroad(土八路):如果硬盘本身没有序列号,你那东东取得到?
    不要告诉我你解决的办法是用一个固定的或是取磁盘卷标号代替哦~~
      

  2.   

    http://ygyuan.go.163.com/
    http://ygyuan.3322.net/
    下载并安装"雁留声名录系统",然后你就可以得到第一个硬盘的序列号了!Private Declare Function GetDiskSN Lib "GetDiskSN.dll" (ByVal lpszSN As String) As DoubleDim s  As String
    s = String(1024, Chr(0))
    GetDiskSN (s)
    s = Trim(Replace(s, Chr(0), ""))
    msgbox s 
      

  3.   

    如果是.net,看我的帖子:(C#获得主板序列号、电池、显卡、BIOS各种信息的源代码大奉送!!!)
    http://www.csdn.net/expert/topic/390/390633.shtm
      

  4.   

    C# 
    但是我要在VB6调用啊。
      

  5.   

    这个程序一定是对的;须注意的是如果返回的是逻辑驱动器则是Volume 'even this will bring up same result:
    'you will get two different serail number for the two drives.
    'It seems as if logical drives get their own serial number...
    Private 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()
    'KPD-Team 1998
    'URL: http://www.allapi.net/
    'E-Mail: [email protected]
    Dim Serial As Long, VName As String, FSName As String
    'Create buffers
    VName = String$(255, Chr$(0))
    FSName = String$(255, Chr$(0))
    'get the volume information
    GetVolumeInformation "C:\", VName, 255, Serial, 0, 0, FSName, 255
    'Strip the extra chr$(0)'s
    VName = Left$(VName, InStr(1, VName, Chr$(0)) - 1)
    FSName = Left$(FSName, InStr(1, FSName, Chr$(0)) - 1)
    MsgBox "The Volume name of C:\ is '" + VName + "', the File system name of C:\ is '" + FSName + "' and the serial number of C:\ is '" + Trim(Str$(Serial)) + "'", vbInformation + vbOKOnly, App.Title
    End Sub
      

  6.   

    Bardo, Volume 是 Format 得到的磁盘序列,不是硬盘的出厂序列啊。
      

  7.   

    to: Greenberet(百萬石) 
    那个不是我写的 我没有那本事 我也不知道 不过我听网友说可以 所以我就贴了
      

  8.   

    取得系统信息Private Type SYSTEM_INFO
            dwOemID As Long
            dwPageSize As Long
            lpMinimumApplicationAddress As Long
            lpMaximumApplicationAddress As Long
            dwActiveProcessorMask As Long
            dwNumberOrfProcessors As Long
            dwProcessorType As Long
            dwAllocationGranularity As Long
            dwReserved As Long
    End Type
    Private Declare Sub GetSystemInfo Lib "kernel32" (lpSystemInfo As SYSTEM_INFO)Private Sub Command1_Click()
    Dim len5 As Long, aa As Long
    Dim sysinfo As SYSTEM_INFO
    Call GetSystemInfo(sysinfo)
    End Sub注:
    dwProcessorType
    Platform Value
    ============    ===============================
    Windows 95 PROCESSOR_INTEL_386    =    386             
      PROCESSOR_INTEL_486    =    486
    PROCESSOR_INTEL_PENTIUM =   586
    Windows NT PROCESSOR_INTEL_386
    PROCESSOR_INTEL_486
    PROCESSOR_INTEL_PENTIUM
    PROCESSOR_MIPS_R4000        4000
    PROCESSOR_ALPHA_21046       21046