Finding Total Bytes and Bytes Available on an SD Card

Last post 05-07-2008 1:53 by ChrisDeveloper. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 05-05-2008 10:41

    Finding Total Bytes and Bytes Available on an SD Card

    In 14 SDF I used to be able to work out the amount of free space using the following two statements.

    OpenNETCF.IO.StorageCard.GetDiskFreeSpace("SD Card").TotalFreeBytes 

    OpenNETCF.IO.StorageCard.GetDiskFreeSpace("SD Card").TotalBytes

    I can see that in 2.2 the Namespace has changed to: OpenNETCF.IO.DriveInfo but I can't work out to use the new class to get the Total and available bytes from a names device like 'SD Card'.

  • 05-07-2008 1:53 In reply to

    Re: Finding Total Bytes and Bytes Available on an SD Card

     Managed to find my own answer to this:

    Just in case anyone else has the same problem I used:

    OpenNETCF.IO.DriveInfo.GetDrives(0).TotalFreeSpace and OpenNETCF.IO.DriveInfo.GetDrives(0).TotalSize 

    But the (0) could be different for other machines as it's a collection. 

Page 1 of 1 (2 items)