![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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