含目录底下的子目录,求得其所有文件大小之总和其第二个叁数的目的是起始Static型态的totbyte,呼叫它时,请不要传叁数进去
PrivateSubCommand1_Click()
DimtotAsLong
tot=GetDirTotalByte("c:ools")
Debug.Printtot
EndSub
PrivateFunctionGetDirTotalByte(CurrentPathAsString,OptionaliAsLong)AsLong
StatictotbyteAsLong
DimnIAsInteger,nDirectoryAsInteger
DimsFileNameAsString,sDirectoryList()AsString
注释:Initialtotbyte,ifitisnottheRecursivecallthefunction
Ifi1Then
totbyte=0
EndIf
注释:Firstlistallnormalfilesinthisdirectory
sFileName=Dir(Current...[ 查看全文 ]