PDA(WIN CE/WINDOWS MOBILE)의 디스크 용량 정보 구하는 API입니다.
[System.Runtime.InteropServices.DllImport("coredll", SetLastError = true)]
static extern bool GetDiskFreeSpaceEx(string directoryName, ref long freeBytesAvailable, ref long totalBytes, ref long totalFreeBytes);
private void button_Click(object sender, EventArgs e)
{
long freeBytesAvailable = 0, totalBytes = 0, totalFreeBytes = 0;
if (GetDiskFreeSpaceEx("\\Application", ref freeBytesAvailable, ref totalBytes, ref totalFreeBytes))
{
MessageBox.Show(freeBytesAvailable + "\n" + totalBytes + "\n" + totalFreeBytes);
}
}
'C#' 카테고리의 다른 글
[C#/PDA]파일 또는 디렉토리 생성시간 설정 및 예제 (0) | 2016.03.08 |
---|---|
[C#]드라이브 정보 얻기 예제 (0) | 2016.03.07 |
[C#/PDA]시스템 특수 폴더 경로 검색 예제 (0) | 2016.03.04 |
[C#/PDA]실행파일 이름 구하기 예제 (0) | 2016.03.04 |
[C#]임의의 폴더 이름 또는 임의의 파일 이름 구하기 예제 (0) | 2016.03.03 |