#include <windows.h>
#include <stdio.h> int main()
{
int nDiskCheck;
unsigned int nDiskType;
char Drive[10];
ULARGE_INTEGER m_lFreeBytesAvailableToCaller;
ULARGE_INTEGER m_lTotalNumberOfBytes;
ULARGE_INTEGER m_lTotalNumberOfFreeBytes;
for (nDiskCheck='C' ; nDiskCheck <= 'Z' ; nDiskCheck++)
{
wsprintf(Drive, "%c:", nDiskCheck);
nDiskType = GetDriveType(Drive);
if (nDiskType == DRIVE_FIXED) // HDD
{
int res = GetDiskFreeSpaceEx( Drive,
&m_lFreeBytesAvailableToCaller,
&m_lTotalNumberOfBytes,
&m_lTotalNumberOfFreeBytes );
printf("****************************************n");
printf("Disk Name => %sn", Drive);
printf("Total Disk Space => %ldn", m_lTotalNumberOfBytes.QuadPart/1024);
printf("Free Disk Space => %ldn", m_lTotalNumberOfFreeBytes.QuadPart/1024);
printf("Using Disk Space => %ldn", ( (m_lTotalNumberOfBytes.QuadPart/1024) -(m_lTotalNumberOfFreeBytes.QuadPart/1024)));
}
}
return 0;
}
#include <stdio.h> int main()
{
int nDiskCheck;
unsigned int nDiskType;
char Drive[10];
ULARGE_INTEGER m_lFreeBytesAvailableToCaller;
ULARGE_INTEGER m_lTotalNumberOfBytes;
ULARGE_INTEGER m_lTotalNumberOfFreeBytes;
for (nDiskCheck='C' ; nDiskCheck <= 'Z' ; nDiskCheck++)
{
wsprintf(Drive, "%c:", nDiskCheck);
nDiskType = GetDriveType(Drive);
if (nDiskType == DRIVE_FIXED) // HDD
{
int res = GetDiskFreeSpaceEx( Drive,
&m_lFreeBytesAvailableToCaller,
&m_lTotalNumberOfBytes,
&m_lTotalNumberOfFreeBytes );
printf("****************************************n");
printf("Disk Name => %sn", Drive);
printf("Total Disk Space => %ldn", m_lTotalNumberOfBytes.QuadPart/1024);
printf("Free Disk Space => %ldn", m_lTotalNumberOfFreeBytes.QuadPart/1024);
printf("Using Disk Space => %ldn", ( (m_lTotalNumberOfBytes.QuadPart/1024) -(m_lTotalNumberOfFreeBytes.QuadPart/1024)));
}
}
return 0;
}
'IT_Programming > C · C++' 카테고리의 다른 글
[코드보기] strtok (0) | 2007.11.26 |
---|---|
[C] fgets 함수 사용시 문자열 끝에 개행문자 제거 방법 (0) | 2007.11.25 |
HOWTO: Visual C++ 어플리케이션에서 메모리 누수 추적하는 방법 (0) | 2007.08.30 |
strcpy(), strcat(), strlen(), strcmp() 함수를 직접 만드시오 (포인터연습) (0) | 2007.01.29 |
[ 터보 C++ ] 간단한 계산기 만들기 (0) | 2007.01.26 |