Good afternoon Europe, goodmorning US,
Is there a method to obtain the number of total memory and the number of free memory on a SD card or USB pendrive?
Cu, Wim.
Good afternoon Europe, goodmorning US,
Is there a method to obtain the number of total memory and the number of free memory on a SD card or USB pendrive?
Cu, Wim.
Try this:
NETMF:
static void RemovableMedia_Insert(object sender, MediaEventArgs e)
{
Debug.Print("Total free: " +e.Volume.TotalFreeSpace);
Debug.Print("Total size: " +e.Volume.TotalSize);
}
.NET
long totalFreeSpace = DriveInfo.GetDrives()[0].TotalFreeSpace;
long totalSize = DriveInfo.GetDrives()[0].TotalSize;
I hope it works.
Yes, thanks that is it.
Why didn’t I find that. :-[
Just needed the .NETMF part for a microSD card in a FEZ Domino.
But is is OK on a USB pendrive as well.