Microsoft Certified Solutions Developer (MCSD) Certification Practice Test

Disable ads (and more) with a membership for a one time $2.99 payment

Prepare for the Microsoft Certified Solutions Developer Certification Test with multiple choice questions and flashcards. Each question comes with hints and explanations. Start mastering your skills now!

Each practice test/flash card set has 50 randomly selected questions from a bank of over 500. You'll get a new set of questions each time!

Practice this question and more.


Which class is used in C# to access drive information?

  1. FileInfo

  2. DirectoryInfo

  3. DriveInfo

  4. FileSystemInfo

The correct answer is: DriveInfo

The DriveInfo class in C# is specifically designed to provide information about the drives on a computer. It allows you to access details such as the drive name, available space, total size, drive format, and much more. This class is a part of the System.IO namespace and is crucial for applications that need to interact with different storage devices. DriveInfo provides methods to determine the properties of a drive, such as checking if it is ready for use, the amount of free space, and the drive type (e.g., fixed, removable, network). This makes it an essential tool for developers who need to manage storage resources within their applications. While the other classes listed—FileInfo, DirectoryInfo, and FileSystemInfo—are also useful in the context of file and directory operations, they do not provide the specialized functionality for accessing drive-level information that DriveInfo offers. FileInfo focuses on files, DirectoryInfo pertains to directories, and FileSystemInfo serves as a base class for file and directory information but does not directly deal with drives. Therefore, the correct answer efficiently addresses the need for drive-specific information in C#.