Страница: 1 |
Вопрос: Получить свободное место | Добавлено: 13.03.07 12:54 |
Автор вопроса: ![]() |
Как в VB6 получить свободноеместо на диске? |
Ответы | Всего ответов: 2 |
Номер ответа: 1 Автор ответа: ![]() ![]() ![]() ICQ: 298826769 Вопросов: 53 Ответов: 1732 |
Профиль | Цитата | #1 | Добавлено: 13.03.07 13:10 |
Из API-Guide (http://www.allapi.net/):
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" ![]() Me.Print " Total Free Bytes:", Format$(TotalFreeBytes * 10000, "###,###,###,##0" ![]() Me.Print " Free Bytes Available:", Format$(BytesFreeToCalller * 10000, "###,###,###,##0" ![]() Me.Print " Total Space Used :", Format$((TotalBytes - TotalFreeBytes) * 10000, "###,###,###,##0" ![]() End Sub |
Номер ответа: 2 Автор ответа: ![]() ![]() ![]() ICQ: 789764 Вопросов: 90 Ответов: 230 |
Web-сайт: Профиль | Цитата | #2 | Добавлено: 13.03.07 13:23 |
Спасиб большое, признателен |
Страница: 1 |
|