■ GetDiskFreeSpaceEx API 함수를 선언하는 방법을 보여준다.
▶ 예제 코드 (C#)
1 2 3 4 5 6 7 8 9 10 11 12 |
using System.Runtime.InteropServices; [DllImport("kernel32", SetLastError = true, CharSet = CharSet.Auto)] private static extern bool GetDiskFreeSpaceEx ( string directoryName , // 디렉토리명 out ulong userFreeByteCount , // 사용자 잔여 바이트 카운트 out ulong userTotalByteCount, // 사용자 전체 바이트 카운트 out ulong totalFreeByteCount // 전체 잔여 바이트 카운트 ); |