Click or drag to resize

Path Class

Performs operations on String instances that contain file or directory path information. These operations are performed in a cross-platform manner.
Inheritance Hierarchy
SystemObject
  Alphaleonis.Win32.FilesystemPath

Namespace:  Alphaleonis.Win32.Filesystem
Assembly:  AlphaFS (in AlphaFS.dll) Version: 2.2
Syntax
public static class Path

The Path type exposes the following members.

Methods
  NameDescription
Public methodStatic memberAddTrailingDirectorySeparator(String)
[AlphaFS] Adds a trailing DirectorySeparatorChar character to the string, when absent.
Public methodStatic memberAddTrailingDirectorySeparator(String, Boolean)
[AlphaFS] Adds a trailing DirectorySeparatorChar or AltDirectorySeparatorChar character to the string, when absent.
Public methodStatic memberChangeExtension
Changes the extension of a path string.
Public methodStatic memberCombine
Combines an array of strings into a path.
Public methodStatic memberGetDirectoryName(String)
Returns the directory information for the specified path string.
Public methodStatic memberGetDirectoryName(String, Boolean)
[AlphaFS] Returns the directory information for the specified path string.
Public methodStatic memberGetDirectoryNameWithoutRoot
[AlphaFS] Returns the directory information for the specified path string without the root information, for example: "C:\Windows\system32" returns: "Windows".
Public methodStatic memberGetDirectoryNameWithoutRootTransacted
[AlphaFS] Returns the directory information for the specified path string without the root information, for example: "C:\Windows\system32" returns: "Windows".
Public methodStatic memberGetExtension(String)
Returns the extension of the specified path string.
Public methodStatic memberGetExtension(String, Boolean)
Returns the extension of the specified path string.
Public methodStatic memberGetFileName(String)
Returns the file name and extension of the specified path string.
Public methodStatic memberGetFileName(String, Boolean)
[AlphaFS] Returns the file name and extension of the specified path string.
Public methodStatic memberGetFileNameWithoutExtension(String)
Returns the file name of the specified path string without the extension.
Public methodStatic memberGetFileNameWithoutExtension(String, Boolean)
[AlphaFS] Returns the file name of the specified path string without the extension.
Public methodStatic memberGetFinalPathNameByHandle(SafeFileHandle)
[AlphaFS] Retrieves the final path for the specified file, formatted as FinalPathFormats.
Public methodStatic memberGetFinalPathNameByHandle(SafeFileHandle, FinalPathFormats)
[AlphaFS] Retrieves the final path for the specified file, formatted as FinalPathFormats.
Public methodStatic memberGetFullPath(String)
Returns the absolute path for the specified path string.
Public methodStatic memberGetFullPath(String, GetFullPathOptions)
Returns the absolute path for the specified path string.
Public methodStatic memberGetFullPathTransacted(KernelTransaction, String)
[AlphaFS] Returns the absolute path for the specified path string.
Public methodStatic memberGetFullPathTransacted(KernelTransaction, String, GetFullPathOptions)
[AlphaFS] Returns the absolute path for the specified path string.
Public methodStatic memberGetInvalidFileNameChars
Gets an array containing the characters that are not allowed in file names.
Public methodStatic memberGetInvalidPathChars
Gets an array containing the characters that are not allowed in path names.
Public methodStatic memberGetLongFrom83ShortPath
[AlphaFS] Converts the specified existing path to its regular long form.
Public methodStatic memberGetLongFrom83ShortPathTransacted
[AlphaFS] Converts the specified existing path to its regular long form.
Public methodStatic memberGetLongPath
Makes an extended long path from the specified path by prefixing LongPathPrefix.
Public methodStatic memberGetMappedConnectionName
[AlphaFS] Gets the connection name of the locally mapped drive.
Public methodStatic memberGetMappedUncName
[AlphaFS] Gets the network share name from the locally mapped path.
Public methodStatic memberGetPathRoot(String)
Gets the root directory information of the specified path.
Public methodStatic memberGetPathRoot(String, Boolean)
[AlphaFS] Gets the root directory information of the specified path.
Public methodStatic memberGetRandomFileName
Returns a random folder name or file name.
Public methodStatic memberGetRegularPath
[AlphaFS] Gets the regular path from long prefixed one. i.e.: "\\?\C:\Temp\file.txt" to C:\Temp\file.txt" or: "\\?\UNC\Server\share\file.txt" to "\\Server\share\file.txt".
Public methodStatic memberGetRelativePath
[AlphaFS] Gets the relative path from the startPath path to the end path.
Public methodStatic memberGetShort83Path
[AlphaFS] Retrieves the short path form of the specified path.
Public methodStatic memberGetShort83PathTransacted
[AlphaFS] Retrieves the short path form of the specified path.
Public methodStatic memberGetSuffixedDirectoryName
[AlphaFS] Returns the directory information for the specified path with a trailing DirectorySeparatorChar character.
Public methodStatic memberGetSuffixedDirectoryNameTransacted
[AlphaFS] Returns the directory information for the specified path with a trailing DirectorySeparatorChar character.
Public methodStatic memberGetSuffixedDirectoryNameWithoutRoot
[AlphaFS] Returns the directory information for the specified path without the root and with a trailing DirectorySeparatorChar character.
Public methodStatic memberGetSuffixedDirectoryNameWithoutRootTransacted
[AlphaFS] Returns the directory information for the specified path without the root and with a trailing DirectorySeparatorChar character.
Public methodStatic memberGetTempFileName
Creates a uniquely named, zero-byte temporary file on disk and returns the full path of that file.
Public methodStatic memberGetTempPath
Returns the path of the current user's temporary folder.
Public methodStatic memberGetTempPath(String)
[AlphaFS] Returns the path of the current user's temporary folder.
Public methodStatic memberHasExtension
Determines whether a path includes a file name extension.
Public methodStatic memberIsLogicalDrive
[AlphaFS] Checks if path is in a logical drive format, such as "C:", "D:".
Public methodStatic memberIsLongPath
[AlphaFS] Determines whether the specified path starts with a LongPathPrefix or LongPathUncPrefix.
Public methodStatic memberIsPathRooted(String)
Gets a value indicating whether the specified path string contains absolute or relative path information.
Public methodStatic memberIsPathRooted(String, Boolean)
[AlphaFS] Gets a value indicating whether the specified path string contains absolute or relative path information.
Public methodStatic memberIsUncPath
[AlphaFS] Determines if a path string is a valid Universal Naming Convention (UNC) path.
Public methodStatic memberIsValidName
[AlphaFS] Check if file or folder name has any invalid characters.
Public methodStatic memberLocalToUnc(String)
[AlphaFS] Converts a local path to a network share path.

A Local path, e.g.: "C:\Windows" or "C:\Windows\" will be returned as: "\\localhost\C$\Windows".

If a logical drive points to a network share path (mapped drive), the share path will be returned without a trailing DirectorySeparator character.

Public methodStatic memberLocalToUnc(String, GetFullPathOptions)
[AlphaFS] Converts a local path to a network share path, optionally returning it as a long path format and the ability to add or remove a trailing backslash.

A Local path, e.g.: "C:\Windows" or "C:\Windows\" will be returned as: "\\localhost\C$\Windows".

If a logical drive points to a network share path (mapped drive), the share path will be returned without a trailing DirectorySeparator character.

Public methodStatic memberLocalToUnc(String, PathFormat)
[AlphaFS] Converts a local path to a network share path.

A Local path, e.g.: "C:\Windows" or "C:\Windows\" will be returned as: "\\localhost\C$\Windows".

If a logical drive points to a network share path (mapped drive), the share path will be returned without a trailing DirectorySeparator character.

Public methodStatic memberLocalToUnc(String, PathFormat, GetFullPathOptions)
[AlphaFS] Converts a local path to a network share path, optionally returning it as a long path format and the ability to add or remove a trailing backslash.

A Local path, e.g.: "C:\Windows" or "C:\Windows\" will be returned as: "\\localhost\C$\Windows".

If a logical drive points to a network share path (mapped drive), the share path will be returned without a trailing DirectorySeparator character.

Public methodStatic memberRemoveTrailingDirectorySeparator(String)
[AlphaFS] Removes the trailing DirectorySeparatorChar character from the string, when present.
Public methodStatic memberRemoveTrailingDirectorySeparator(String, Boolean)
[AlphaFS] Removes the trailing DirectorySeparatorChar or AltDirectorySeparatorChar character from the string, when present.
Public methodStatic memberResolveRelativePath
[AlphaFS] Gets the absolute path from the relative or absolute startPath and the relative selectedPath.
Top
Fields
  NameDescription
Public fieldStatic memberAltDirectorySeparator
[AlphaFS] AltDirectorySeparatorChar = "/" Provides a platform-specific alternate string used to separate directory levels in a path string that reflects a hierarchical file system organization.
Public fieldStatic memberAltDirectorySeparatorChar
AltDirectorySeparatorChar = '/' Provides a platform-specific alternate character used to separate directory levels in a path string that reflects a hierarchical file system organization.
Public fieldStatic memberCurrentDirectoryPrefix
[AlphaFS] CurrentDirectoryPrefix = "." Provides a current directory string.
Public fieldStatic memberCurrentDirectoryPrefixChar
[AlphaFS] CurrentDirectoryPrefix = '.' Provides a current directory character.
Public fieldStatic memberDevicePrefix
[AlphaFS] DevicePrefix = "\Device\" Provides standard Windows Device prefix.
Public fieldStatic memberDirectorySeparator
[AlphaFS] DirectorySeparator = "\" Provides a platform-specific string used to separate directory levels in a path string that reflects a hierarchical file system organization.
Public fieldStatic memberDirectorySeparatorChar
DirectorySeparatorChar = '\' Provides a platform-specific character used to separate directory levels in a path string that reflects a hierarchical file system organization.
Public fieldStatic memberDosDeviceLanmanPrefix Obsolete.
[AlphaFS] DosDeviceLanmanPrefix = "\Device\LanmanRedirector\" Provides a MS-Dos Lanman Redirector Path UNC prefix to a network share.
Public fieldStatic memberDosDeviceMupPrefix Obsolete.
[AlphaFS] DosDeviceMupPrefix = "\Device\Mup\" Provides a MS-Dos Mup Redirector Path UNC prefix to a network share.
Public fieldStatic memberDosDeviceUncPrefix
[AlphaFS] DosDeviceUncPrefix = "\??\UNC\" Provides a SUBST.EXE Path UNC prefix to a network share.
Public fieldStatic memberExtensionSeparatorChar
[AlphaFS] ExtensionSeparatorChar = '.' Provides an Extension Separator character.
Public fieldStatic memberGlobalRootPrefix
[AlphaFS] GlobalRootPrefix = "\\?\GlobalRoot\" Provides standard Windows Volume prefix.
Public fieldStatic memberLogicalDrivePrefix
[AlphaFS] Win32 Device Namespace. The "\\.\"prefix is how to access physical disks and volumes, without going through the file system, if the API supports this type of access.
Public fieldStatic memberLongPathPrefix
[AlphaFS] Win32 File Namespace. The "\\?\" prefix to a path string tells the Windows APIs to disable all string parsing and to send the string that follows it straight to the file system.
Public fieldStatic memberLongPathUncPrefix
[AlphaFS] LongPathUncPrefix = "\\?\UNC\" Provides standard Windows Long Path UNC prefix.
Public fieldStatic memberNetworkDriveSeparator
[AlphaFS] NetworkDriveSeparator = "$" Provides a platform-specific network drive separator string.
Public fieldStatic memberNetworkDriveSeparatorChar
[AlphaFS] NetworkDriveSeparator = '$' Provides a platform-specific network drive separator character.
Public fieldStatic memberNonInterpretedPathPrefix
[AlphaFS] NonInterpretedPathPrefix = "\??\" Provides a non-interpreted path prefix.
Public fieldStatic memberParentDirectoryPrefix
[AlphaFS] ParentDirectoryPrefix = ".." Provides a parent directory string.
Public fieldStatic memberPathSeparator
PathSeparator = ';' A platform-specific separator character used to separate path strings in environment variables.
Public fieldStatic memberPhysicalDrivePrefix
[AlphaFS] PhysicalDrivePrefix = "\\.\PhysicalDrive" Provides standard physical drive prefix.
Public fieldStatic memberStreamDataLabel
[AlphaFS] StreamDataLabel = ':$DATA' Provides a platform-specific Stream :$DATA label.
Public fieldStatic memberStreamSeparator
[AlphaFS] StreamSeparator = ':' Provides a platform-specific Stream-name string.
Public fieldStatic memberStreamSeparatorChar
[AlphaFS] StreamSeparator = ':' Provides a platform-specific Stream-name character.
Public fieldStatic memberStringTerminatorChar
[AlphaFS] StringTerminatorChar = '\0' String Terminator Suffix.
Public fieldStatic memberUncPrefix
[AlphaFS] UncPrefix = "\\" Provides standard Windows Path UNC prefix.
Public fieldStatic memberWildcardQuestion
[AlphaFS] WildcardQuestion = "?" Provides a replace-item string.
Public fieldStatic memberWildcardQuestionChar
[AlphaFS] WildcardQuestion = '?' Provides a replace-item string.
Public fieldStatic memberWildcardStarMatchAll
[AlphaFS] WildcardStarMatchAll = "*" Provides a match-all-items string.
Public fieldStatic memberWildcardStarMatchAllChar
[AlphaFS] WildcardStarMatchAll = '*' Provides a match-all-items character.
Public fieldStatic memberVolumePrefix
[AlphaFS] VolumePrefix = "\\?\Volume" Provides standard Windows Volume prefix.
Public fieldStatic memberVolumeSeparator
[AlphaFS] VolumeSeparator = ":" Provides a platform-specific Volume Separator string.
Public fieldStatic memberVolumeSeparatorChar
VolumeSeparatorChar = ':' Provides a platform-specific Volume Separator character.
Top
See Also