| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1013 人关注过本帖
标题:帮我看下这断程序大侠们
取消只看楼主 加入收藏
b123456
Rank: 1
等 级:新手上路
帖 子:56
专家分:0
注 册:2008-9-22
收藏
 问题点数:0 回复次数:3 
帮我看下这断程序大侠们
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 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这里未定义或未声明这是怎么回事?
我是照着我的书上学的 然后打上去的
2008-10-16 19:24
b123456
Rank: 1
等 级:新手上路
帖 子:56
专家分:0
注 册:2008-9-22
收藏
得分:0 
谢谢版主.!。我的错误解决了 .
2008-10-16 20:26
b123456
Rank: 1
等 级:新手上路
帖 子:56
专家分:0
注 册:2008-9-22
收藏
得分:0 
另外那个右健+ALT 什么意思?我听不懂
2008-10-16 20:27
b123456
Rank: 1
等 级:新手上路
帖 子:56
专家分:0
注 册:2008-9-22
收藏
得分:0 
另外在问个问题
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
这声明部分 这几个是什么意思?还有&H8这些都是什么意思?
ASCII码?
2008-10-16 20:33
快速回复:帮我看下这断程序大侠们
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.043585 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved