Private Declare Function GetDiskFreeSpaceEx Lib "kernel32" Alias "GetDiskFreeSpaceExA" _
(ByVal lpRootPathName As String, _
lpFreeBytesAvailableToCaller As Currency, _
lpTotalNumberOfBytes As Currency, _
lpTotalNumberOfFreeBytes As Currency) As Long
Private Sub Command1_Click()
Dim r As Long
Dim BytesFreeToCalller As Currency
Dim TotalBytes As Currency
Dim TotalFreeBytes As Currency
Dim TotalBytesUsed As Currency
Dim RootPathName As String
RootPathName = "C:\"
Call GetDiskFreeSpaceEx(RootPathName, BytesFreeToCalller, TotalBytes, TotalFreeBytes)
MsgBox "총디스크공간 - "" & Format(TotalBytes * 10000, "#,##0") & "" 바이트"
MsgBox "총여유공간 - "" & Format(TotalFreeBytes * 10000, "#,##0") & "" 바이트"
MsgBox "사용된공간 - "" & Format((TotalBytes - TotalFreeBytes) * 10000, "#,##0") & "" 바이트"
End Sub
첫댓글 MsgBox에 "" 를 " 로 고쳐주니까 잘 돌아갑니다.