728x90
반응형
728x170
■ GetDiskFreeSpaceEx API 함수를 선언하는 방법을 보여준다.
▶ 예제 코드 (C#)
using System.Runtime.InteropServices;
#region 디스크 자유 공간 구하기 (확장) - GetDiskFreeSpaceEx(directoryName, userFreeByteCount, userTotalByteCount, totalFreeByteCount)
/// <summary>
/// 디스크 자유 공간 구하기 (확장)
/// </summary>
/// <param name="directoryName">디렉토리명</param>
/// <param name="userFreeByteCount">사용자 잔여 바이트 카운트</param>
/// <param name="userTotalByteCount">사용자 전체 바이트 카운트</param>
/// <param name="totalFreeByteCount">전체 잔여 바이트 카운트</param>
/// <returns>처리 결과</returns>
[DllImport("kernel32", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
private static extern bool GetDiskFreeSpaceEx(string directoryName, out ulong userFreeByteCount, out ulong userTotalByteCount, out ulong totalFreeByteCount);
#endregion
728x90
반응형
그리드형(광고전용)
'C# > WIN32' 카테고리의 다른 글
[C#/WIN32] WTSFreeMemory API 함수 선언하기 (0) | 2021.06.11 |
---|---|
[C#/WIN32] WTSQuerySessionInformationW API 함수 선언하기 (0) | 2021.06.11 |
[C#/WIN32] WTSGetActiveConsoleSessionId API 함수 선언하기 (0) | 2021.06.11 |
[C#/WIN32] NtQueryInformationProcess API 함수 선언하기 (0) | 2021.06.09 |
[C#/WIN32] GetNetworkParams API 함수 선언하기 (0) | 2021.06.05 |
[C#/WIN32] GetSystemPowerStatus API 함수 선언하기 (0) | 2021.06.05 |
[C#/WIN32] GlobalMemoryStatusEx API 함수 선언하기 (0) | 2021.06.05 |
[C#/WIN32] GetSystemInfo API 함수 선언하기 (0) | 2021.06.05 |
[C#/WIN32] IsProcessorFeaturePresent API 함수 선언하기 (0) | 2021.06.05 |
[C#/WIN32] GetLogicalProcessorInformation API 함수 선언하기 (0) | 2021.06.05 |
댓글을 달아 주세요