1/23
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai | Chat |
|---|
No analytics yet
Send a link to your students to track their progress
Path
A static class in System.IO that provides methods and properties for manipulating strings containing file and directory paths without directly creating, reading, moving, or deleting those filesystem objects. Domain: C# → .NET → System.IO → Paths
Path.Combine(path1, path2)
Combines two path components into a single path using the appropriate directory separator for the platform.
Path.Join(path1, path2)
Joins path components using an appropriate directory separator while performing less validation than Path.Combine.
Path.GetFileName(path)
Returns the file name and extension portion of a path.
Path.GetFileNameWithoutExtension(path)
Returns the file name portion of a path without its extension.
Path.GetExtension(path)
Returns the extension of the specified path, including the leading period when an extension exists.
Path.ChangeExtension(path, extension)
Returns a path string whose extension has been changed to the specified extension.
Path.GetDirectoryName(path)
Returns the directory information portion of the specified path.
Path.GetFullPath(path)
Returns an absolute path corresponding to the specified path.
Path.GetRelativePath(relativeTo, path)
Returns a relative path from one specified path to another.
Path.IsPathRooted(path)
Determines whether a path begins with a root component rather than being purely relative.
Path.IsPathFullyQualified(path)
Determines whether a path is fully qualified and does not depend on the current directory for interpretation.
Path.GetPathRoot(path)
Returns the root portion of the specified path.
Path.DirectorySeparatorChar
Gets the platform-specific character used to separate directory levels in a path.
Path.AltDirectorySeparatorChar
Gets an alternative directory separator character supported by the platform.
Path.PathSeparator
Gets the platform-specific character used to separate individual paths in a list of paths, such as an environment path variable.
Path.VolumeSeparatorChar
Gets the platform-specific volume separator character.
Path.GetTempPath()
Returns the path of the current user's or system's temporary directory according to the environment.
Path.GetTempFileName()
Creates a uniquely named zero-byte temporary file and returns its full path.
Path.GetRandomFileName()
Returns a cryptographically strong random file or directory name without creating the file or directory.
Path.HasExtension(path)
Determines whether the specified path contains a file-name extension.
Path.GetInvalidFileNameChars()
Returns an array containing characters that are not permitted in file names on the current platform.
Path.GetInvalidPathChars()
Returns an array containing characters that are not permitted in path strings on the current platform.
Path Exists vs Path String
The Path class primarily manipulates path strings; a path processed by Path does not necessarily correspond to a file or directory that actually exists.