public static DriveInfo[] GetDrives() { string[] drives = DriveInfoInternal.GetLogicalDrives(); DriveInfo[] result = new DriveInfo[drives.Length]; for (int i = 0; i < drives.Length; i++) { result[i] = new DriveInfo(drives[i]); } return result; }
public IReadOnlyList <DriveInfo> GetMountedDrives() => IoDriveInfo .GetDrives() .Select(CreateFrom) .WhereNotNull() .ToArray();