0

I've got a DriveInfo object. I want to find out whether the drive is the Windows Drive(on my PC it's C:) because you can't right to the root directory of the Windows Drive.

trinalbadger587
  • 1,905
  • 1
  • 18
  • 36

1 Answers1

1

You could use string path = Path.GetPathRoot(Environment.SystemDirectory); and than check agains the drive name, like C:\ or D:\, ...

BendEg
  • 20,098
  • 17
  • 57
  • 131