C# DriveInfo DriveInfo

Description

DriveInfo DriveInfo Provides access to information on the specified drive.

Syntax

DriveInfo.DriveInfo has the following syntax.


public DriveInfo(
  string driveName
)

Parameters

DriveInfo.DriveInfo has the following parameters.

  • driveName - A valid drive path or drive letter. This can be either uppercase or lowercase, 'a' to 'z'. A null value is not valid.

Example

DriveInfo.DriveInfo


using System;/*from   ww  w .j  a v  a 2s.  c  o m*/
using System.IO;

class Test
{
    public static void Main()
    {
        DriveInfo d = new DriveInfo("c:/");

        Console.WriteLine("Drive {0}", d.Name);
    }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System.IO »




BinaryReader
BinaryWriter
Directory
DirectoryInfo
DriveInfo
File
FileInfo
FileStream
MemoryStream
Path
StreamReader
StreamWriter
StringReader
StringWriter