public static MountPoint[] GetMountPoints() { DriveInfo[] drives = DriveInfo.GetDrives(); int max = 0; foreach (DriveInfo drive in drives) { if (drive.IsReady && drive.DriveType != DriveType.CDRom) { max++; } } MountPoint[] mounts = new MountPoint[max]; int count = 0; foreach (DriveInfo drive in drives) { if (drive.IsReady && drive.DriveType != DriveType.CDRom) { mounts[count] = new MountPoint(drive.Name, GetDevice(GetMountDevice(drive.Name)), GetMPUsed(drive), GetMPFree(drive), GetMPSize(drive)); count++; } } return(mounts); }
public static MountPoint[] GetMountPoints() { DriveInfo[] drives = DriveInfo.GetDrives(); int max = 0; foreach (DriveInfo drive in drives) { if (drive.IsReady && drive.DriveType != DriveType.CDRom) { max++; } } MountPoint[] mounts = new MountPoint[max]; int count = 0; foreach (DriveInfo drive in drives) { if (drive.IsReady && drive.DriveType != DriveType.CDRom) { mounts[count] = new MountPoint(drive.Name, GetDevice(GetMountDevice(drive.Name)), GetMPUsed(drive), GetMPFree(drive), GetMPSize(drive)); count++; } } return mounts; }