GetVolumeInfo...获得的是卷标号,每次Format后都会不同。在Ring3下也有硬盘ID号的获取方法,详情发信给Joyle吧,让它来这里解答一下,呵呵[email protected]

解决方案 »

  1.   

    在RING3下取得硬盘ID只适用于WIN9X,而不适用于WINNT。
    丁凯的一篇文章《在WIN9X下怎样获得硬盘序列号》有详细介绍
      

  2.   

    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()
        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
      

  3.   

    我遇到过磁盘序列号为“0”的硬盘,这是什么原因?在MS-DOS下键如DIR可看到:Volume Serial Number is 0000-0000    这对加密可是个意外的打击!!!!