GetDiskFreeSpace

[DllImport("Kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)][return: MarshalAs(UnmanagedType.Bool)]
public static extern bool GetDiskFreeSpace(
   string lpRootPathName,
   out uint lpSectorsPerCluster,
   out uint lpBytesPerSector,
   out uint lpNumberOfFreeClusters,
   out uint lpTotalNumberOfClusters
);

Microsoft documentation: Link

Last updated