Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Selected Reading
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
Advertisements
