帮我看下这断程序大侠们
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 LongPrivate Declare Function GetDiskFreeSpace Lib "kernel32" Alias "GetDiskFreeSpaceA" (ByVal lpRootPathName As String, lpSectorsPerCluster As Long, lpBytesPerSector As Long, lpNumberOfFreeClusters As Long, lpTtoalNumberOfClusters As Long) As Long
Private Const fs_case_is_preserved = &H2
Private Const fs_case_sensitive = &H1
Private Const fs_unicode_stored_on_disk = &H4
Private Const fs_persistent_acls = &H8
Private Const fs_file_compression = &H10
Private Const fs_vol_is_compressed = 32768
Private Sub Drive1_Change()
Dim volume As stromg, sysname As String
Dim serialnum As Long, sysflags As Long, componentlength As Long, res As Long
Dim sectorspercluster As Long, bytespersector As Long, numberoffreeclustors As Long, totalnumberofclustors As Long
Dim freebytes As Long, totalbytes As Long, percentfree As Long, dl As Long
Dim drvname As String
list1.Clear
volume = String(256, 0)
sysname = String(256, 0)
drvname = Left(drivel.Drive, 2) & "\"
res = GetVolumeInformation(drvname, volume, 255, serialnum, componentlength, sysflags, sysname, 255)
If res = 0 Then
list1.AddItem "不能得到磁盘信息"
Else
list1.AddItem "卷表:" & Trim(volume)
list1.AddItem "序列号:" & serialnum
list1.AddItem "成分长度:" & componentlength
list1.AddItem "文件系统:" & Trim(sysname)
dl = GetDiskFreeSpace(drvname, sectorspercluster, bytespersector, numberoffreeclustors, totalnumberofclustors)
list1.AddItem "每簇中的扇区数:" & Format(sectorspercluster, "#,0")
list1.AddItem "哪扇区中的字节数:" & Format(bytespersector, "#,0")
list1.AddItem "总簇数:" & Format(totalnumberofclustors, "#,0")
list1.AddItem "剩余簇数:" & Format(numberoffreeclustors, "#,0")
If sysflags And fs_case_ispreserved Then
list1.AddItem "文件名的大小在文件系统中保存记录"
End If
If sysflags And fs_case_sensitive Then
list1.AddItem "文件名要区分大小写"
If sysflags And fs_unicode_stored_on_disk Then
list1.AddItem "文件名保存为unicode格式"
End If
If sysflags And fs_persistent_acls Then
list1.AddItem "文件系统支持文件的访问控制列表(acl)安全机制"
If sysflags And fs_file_compression Then
list1.AddItem "文件系统支持逐个文件进行文件压缩"
End If
If sysflags And fs_vol_is_compressed Then
list1.AddItem "整个磁盘卷标是压缩的"
End If
End Sub
Private Sub Form_Load()
Call drivel_change
End Sub
-------------------------------------------------
这段程序我在编译时 他说Call drivel_change这里未定义或未声明这是怎么回事?
我是照着我的书上学的 然后打上去的