How can I determine free space on a Windows CE device?
问题 I need to determine how much free space there is on a Windows CE device, to conditionally determine whether a particular operation should proceed. I thought Ken Blanco's answer here (which bears a striking similarity to the example yonder) would work, which I adapted as: internal static bool EnoughStorageSpace(long spaceNeeded) { DriveInfo[] allDrives = DriveInfo.GetDrives(); long freeSpace = 0; foreach (DriveInfo di in allDrives) { if (di.IsReady) { freeSpace = di.AvailableFreeSpace; } }