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.
Name | Returns the name of the directory |
FullName | Returns the full name including its full path |
Extension | Returns the extension of the directory |
Exists | Returns true if the directory exists |
Attributes | Sets or returns the attributes of the directory as a bit-coded FileAttrbutes value ? |
CreationTime | sets or returns the creation time of the directory (Date value) |
LastWriteTime | Sets or returns the last write time for the directory (Date value) |
LastAccessTime | Sets or returns the last access time for the directory (Date value) |
Refresh | Refreshes the properties of this object |
Parent | Returns the DirectoryInfo object for the parent directory |
Root | Returns the DirectoryInfo object for the root directory |
Create | Creates 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 |
GetFileSystemInfos | Returns 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