123456789101112131415161718192021222324 |
- using System;
- using System.Collections.Generic;
- using System.IO;
- using System.Linq;
- using System.Text;
- namespace Ips.Library.Basic.IO
- {
- public static class DriveUtil
- {
- public static DriveInfo GetMaxDrive()
- {
- return DriveInfo.GetDrives().Where(d => d.DriveType == DriveType.Fixed).OrderByDescending(m => m.TotalSize).First();
- }
- public static string GetMaxDrivePath(params string[] dirs)
- {
- var drive = GetMaxDrive();
- string dirPath = Path.Combine(dirs);
- var result = Path.Combine(drive.Name, dirPath);
- return result;
- }
- }
- }
|