说三道四技术文摘-感悟人生的经典句子
说三道四 > 文档快照

目录所占的字节数-VB资料

HTML文档下载 WORD文档下载 PDF文档下载
目录所占的字节数-VB资料
该函数返回目录使用的字节数:

Function DirUsedBytes(ByVal dirName As String) As Long
Dim FileName As String
Dim FileSize As Currency
If Right$(dirName, 1) <> "\" Then
dirName = dirName & "\"
Endif
FileSize = 0
FileName = Dir$(dirName & "*.*")
Do While FileName <> ""
FileSize = FileSize + _
FileLen(dirName & FileName)
FileName = Dir$
Loop
DirUsedBytes = FileSize
使用:
MsgBox DirUsedBytes("C:\Windows")

备案号:鲁ICP备13029499号-2 说三道四 www.s3d4.cn 说三道四技术文摘