The Path class provides methods for manipulating a file system path.
Path Methods
ChangeExtension: Takes a path and returns a new path with the file name's extension changed. (Note that only the path string changes, not the actual file name extension.)
Combine: Combines two compatible path strings.
GetDirectoryName: Returns the name of the directory in the specified path.
GetExtension: Returns the name of the file extension in the specified path.
GetFileName: Returns the name of the file in the specified path.
GetFileNameWithoutExtension: Returns the file name without the extension in the
specified path.
GetFullPath: Returns a full path to the specified path. This method can be used to resolve relative paths.
GetPathRoot: Returns the root directory name in the specified path.
GetRandomFileName: Generates a random file name.
GetTempFileName: Generates a temporary file in the file system and returns the full path to the file.
GetTempPath: Returns the path to the temporary file directory for the current user or system.
HasExtension: Indicates whether a specified path's file name has an extension.
IsPathRooted: Indicates whether the specified path includes a root directory.
Path Methods
ChangeExtension: Takes a path and returns a new path with the file name's extension changed. (Note that only the path string changes, not the actual file name extension.)
Combine: Combines two compatible path strings.
GetDirectoryName: Returns the name of the directory in the specified path.
GetExtension: Returns the name of the file extension in the specified path.
GetFileName: Returns the name of the file in the specified path.
GetFileNameWithoutExtension: Returns the file name without the extension in the
specified path.
GetFullPath: Returns a full path to the specified path. This method can be used to resolve relative paths.
GetPathRoot: Returns the root directory name in the specified path.
GetRandomFileName: Generates a random file name.
GetTempFileName: Generates a temporary file in the file system and returns the full path to the file.
GetTempPath: Returns the path to the temporary file directory for the current user or system.
HasExtension: Indicates whether a specified path's file name has an extension.
IsPathRooted: Indicates whether the specified path includes a root directory.