Windows c++获取磁盘剩余容量

ULARGE_INTEGER freeBytesAvailable;
ULARGE_INTEGER totalNumberOfBytes;     //磁盘总字节
ULARGE_INTEGER totalNumberOfFreeBytes;  //空闲字节
GetDiskFreeSpaceEx(L"path", &freeBytesAvailable, &totalNumberOfBytes, &totalNumberOfFreeBytes);//path可以是路径,不必须是盘符
ULONGLONG DiskFreeSpace=totalNumberOfFreeBytes.QuadPart;

 

posted @ 2022-08-26 19:08  banlcer  阅读(417)  评论(0编辑  收藏  举报