C# DriveInfo DriveFormat
Description
DriveInfo DriveFormat
Gets the name of the file system,
such as NTFS or FAT32.
Syntax
DriveInfo.DriveFormat
has the following syntax.
public string DriveFormat { get; }
Example
Gets the name of the file system, such as NTFS or FAT32.
using System;/* w w w. ja v a 2 s . com*/
using System.IO;
class Test
{
public static void Main()
{
DriveInfo[] allDrives = DriveInfo.GetDrives();
foreach (DriveInfo d in allDrives)
{
Console.WriteLine("Drive {0}", d.Name);
Console.WriteLine(" File type: {0}", d.DriveType);
if (d.IsReady == true)
{
Console.WriteLine(" Volume label: {0}", d.VolumeLabel);
Console.WriteLine(" File system: {0}", d.DriveFormat);
}
}
}
}
The code above generates the following result.