码迷,mamicode.com
首页 > 其他好文 > 详细

获取系统磁盘信息

时间:2015-01-14 12:42:21      阅读:142      评论:0      收藏:0      [点我收藏+]

标签:

#define DRIVE_LEN 100

char szDrivers[DRIVE_LEN] = {0};

int i_Drive_Len = DRIVE_LEN;  

GetLogicalDriveStrings(i_Drive_Len, szDrivers);    

char *psz = szDrivers;

 ULARGE_INTEGER FreeBytesAvailableToCaller = {0};  

ULARGE_INTEGER TotalNumberOfBytes = {0};  

ULARGE_INTEGER TotalNumberOfFreeBytes = {0};  

while (*psz != ‘\0‘)  

{   

  GetDiskFreeSpaceEx(psz, &FreeBytesAvailableToCaller, &TotalNumberOfBytes, &TotalNumberOfFreeBytes);   

  printf("%s:FreeBytesAvailableToCaller %llu, TotalNumberOfBytes %llu, TotalNumberOfFreeBytes %llu\n", psz,

  FreeBytesAvailableToCaller.QuadPart, TotalNumberOfBytes.QuadPart, TotalNumberOfFreeBytes.QuadPart);   

  psz += 4;  

}

获取系统磁盘信息

标签:

原文地址:http://www.cnblogs.com/gzxiaohai/p/4223570.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!