System.IO.DirectoryInfo

The DirectoryInfo class represents a single directory
This class inherits from the FileSystemInfo virtual class
You can create a reference to a DirectoryInfo object by using its constructor method

System.IO.DirectoryInfo oDirectoryInfo; 
oDirectoryInfo = new System.IO.DirectoryInfo("C:\Temp\");

Methods

This class exposes instance methods for creating, moving and enumerating through directories, their files and their sub directories.

NameReturns the name of the directory
FullNameReturns the full name including its full path
ExtensionReturns the extension of the directory
ExistsReturns true if the directory exists
AttributesSets or returns the attributes of the directory as a bit-coded FileAttrbutes value ?
CreationTimesets or returns the creation time of the directory (Date value)
LastWriteTimeSets or returns the last write time for the directory (Date value)
LastAccessTimeSets or returns the last access time for the directory (Date value)
RefreshRefreshes the properties of this object
ParentReturns the DirectoryInfo object for the parent directory
RootReturns the DirectoryInfo object for the root directory
CreateCreates the directory
MoveTo(destpath)Moves the directory to another path
Delete([recursive])Deletes the directory
CreateSubDirectory(path)Creates a subdirectory and returns the corresponding DirectoryInfo object
GetDirectories([filespec])Returns information about the subdirectories as an array of DirectoryInfo objects
GetFiles([filespec])Returns information about the files in the directory as an array of FileInfo objects
GetFileSystemInfosReturns information about the files and subdirectories as an array of FileSystemInfo objects


if (objfileinfo.Attributes And IO.FileAttributes.Hidden) <> _ 
    IO.FileAttributes.Hidden)
{
}


© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext