_getdiskfree(uDrive, &df);
The parameters
参数
drive - The disk drive for which you want information.
Drive-你要获取信息的驱动器
driveinfo- A_diskfree_t structure that will be populated with information about the drive.
_diskfree_t is defined in direct.h.
Driveinfo : _diskfree_t 结构体变量,通过这个变量的指针返回驱动器信息,
_diskfree_t在direct.h头文件中定义
The return value
返回值
If the function succeeds, the return value is zero. If the function fails,
the return value is the error code. To get extended error information, call GetLastError().
如果函数成功执行,返回值=0
如果函数执行失败,返回出错代码,要获取更多错误信息,调用GetLaseError函数
The header file
头文件
<direct.h>
Table 6: _getdiskfree() information
表 6 _getdiskfree()函数
§ The following program example uses the _getdiskfree() function to list logical drives information in the current machine.
§ 下面的程序实例通过_getdiskfree()函数获取本机当前可以逻辑驱动器的信息。
#include<windows.h>
#include<direct.h>
#include<stdio.h>
#include<tchar.h>
TCHAR g_szText[ ] = _T(\"Drive Total_clus Available_clus Sec/Cluster Bytes/Secn\");