
- C# Basic Tutorial
- C# - Home
- C# - Overview
- C# - Environment
- C# - Program Structure
- C# - Basic Syntax
- C# - Data Types
- C# - Type Conversion
- C# - Variables
- C# - Constants
- C# - Operators
- C# - Decision Making
- C# - Loops
- C# - Encapsulation
- C# - Methods
- C# - Nullables
- C# - Arrays
- C# - Strings
- C# - Structure
- C# - Enums
- C# - Classes
- C# - Inheritance
- C# - Polymorphism
- C# - Operator Overloading
- C# - Interfaces
- C# - Namespaces
- C# - Preprocessor Directives
- C# - Regular Expressions
- C# - Exception Handling
- C# - File I/O
- C# Advanced Tutorial
- C# - Attributes
- C# - Reflection
- C# - Properties
- C# - Indexers
- C# - Delegates
- C# - Events
- C# - Collections
- C# - Generics
- C# - Anonymous Methods
- C# - Unsafe Codes
- C# - Multithreading
- C# Useful Resources
- C# - Questions and Answers
- C# - Quick Guide
- C# - Useful Resources
- C# - Discussion
Get the drive format in C#
Use the DriveFormat property to get the drive format in C#.
Set the drive for which you want to display the format −
DriveInfo dInfo = new DriveInfo("C");
Now, use DriveFormat to get the drive format −
dInfo.DriveFormat
The drive formats for a windows system can be NTFS or FAT32.
Here is the complete code −
Example
using System; using System.Linq; using System.IO; public class Demo { public static void Main() { DriveInfo dInfo = new DriveInfo("C"); Console.WriteLine("Drive Format = "+dInfo.DriveFormat); } }
Output
The following is the output −
Drive Format = NTFS
- Related Articles
- C# Program to get the name of the drive
- C# Program to get free space in a drive
- How to get complete drive information using C#?
- Format TimeSpan in C#
- Format specifiers in C
- The "0" custom format specifier in C#
- How to get process output in GridView format in PowerShell ?
- How to get the MySQL interactive output format in batch mode also?
- How to get the response in different format in Mock Server using Postman?
- Electric Traction: Steam Engine Drive, Diesel Engine Drive and Electric Drive
- Explain the Format of C language
- Difference between Chain Drive and Belt Drive
- String format for DateTime in C#
- String format for Double in C#
- Sortable ("s") Format Specifier in C#

Advertisements