0

我有一个 DriveInfo 对象。我想知道驱动器是否是 Windows 驱动器(在我的 PC 上是 C:),因为您无法访问 Windows 驱动器的根目录。

4

1 回答 1

1

您可以使用string path = Path.GetPathRoot(Environment.SystemDirectory);and 而不是再次检查驱动器名称,例如C:\or D:\, ...

于 2015-07-19T19:34:34.800 回答