- string strtemp = "c:\\123\\456\\789.txt";
- char uuu[2] = {0};
- uuu [0]= strtemp[0];
- CString firstchar = uuu;
- CString strRootPath=firstchar + ":\\";
-
- DWORD dwSectorsPerCluster=0;
- DWORD dwBytesPerSector=0;
- DWORD dwFreeClusters=0;
- DWORD dwTotalClusters=0;
- if (GetDiskFreeSpace(strRootPath,&dwSectorsPerCluster,&dwBytesPerSector,
- &dwFreeClusters,&dwTotalClusters))
- {
-
- double dd=dwSectorsPerCluster*dwBytesPerSector/(1024.*1024.);
- dd=dd/1024.;
- double m_dFree=dwFreeClusters*dd;
- if (m_dFree < 1)
- {
- WriteToLogAndTime("硬盘空间小于1G,请清理空间");
- AfxMessageBox("硬盘空间小于1G,请清理空间");
- }
- }
posted on
2015-05-29 10:02
carekee
阅读(
1833)
评论()
编辑
收藏
举报