我用getdiskfreespace 这个函数
解决方案 »
- SetDIBitsToDevice怎么用
- 使用 WebBrowser控件时 内存一下子高达50M!!!
- 关于 三角函数 救命
- 在VB中执行SQL脚????
- 奇怪的toolbar按钮问题,请朋友们帮忙诊断一下!
- 如何利用picturebox控件和scroll控件显示较大的图形,或在作图时滚动查看图形
- 呵呵,我又被难倒了,菜鸟的苦啊。。。。。
- 请问谁了解排队系统?
- 能不能在sql语句的where加入函数?如:DateDiff("d", Date, 流通表.应还日期)>=0之类的》?
- 好心的版主啊!帮帮忙吧!
- 急用!!!!往高手赐教!!最好可以通过QQ讨论一下!!!我的:29254632
- 关于菜鸟的迷惑
Create a new project, and add this code to Form1:
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 Form_Load()
Dim r As Long, BytesFreeToCalller As Currency, TotalBytes As Currency
Dim TotalFreeBytes As Currency, TotalBytesUsed As Currency
'the drive to find
Const RootPathName = "C:\"
'get the drive's disk parameters
Call GetDiskFreeSpaceEx(RootPathName, BytesFreeToCalller, TotalBytes, TotalFreeBytes)
'show the results, multiplying the returned
'value by 10000 to adjust for the 4 decimal
'places that the currency data type returns.
Me.AutoRedraw = True
Me.Cls
Me.Print
Me.Print " Total Number Of Bytes:", Format$(TotalBytes * 10000, "###,###,###,##0") & " bytes"
Me.Print " Total Free Bytes:", Format$(TotalFreeBytes * 10000, "###,###,###,##0") & " bytes"
Me.Print " Free Bytes Available:", Format$(BytesFreeToCalller * 10000, "###,###,###,##0") & " bytes"
Me.Print " Total Space Used :", Format$((TotalBytes - TotalFreeBytes) * 10000, "###,###,###,##0") & " bytes"
End Sub