Share via


Path Class

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Performs operations on String instances that contain file or directory path information. These operations are performed in a cross-platform manner.

Inheritance Hierarchy

System. . :: . .Object
  System.IO..::..Path

Namespace:  System.IO
Assembly:  System.IO (in System.IO.dll)

Syntax

'Declaration
Public NotInheritable Class Path
public sealed class Path
public ref class Path sealed
[<Sealed>]
type Path =  class end
public final class Path

The Path type exposes the following members.

Methods

  Name Description
Public methodStatic member ChangeExtension Changes the extension of a path string.
Public methodStatic member Combine Combines two strings into a path.
Public method Equals(Object) Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public methodStatic member GetDirectoryName Returns the directory information for the specified path string.
Public methodStatic member GetExtension Returns the extension of the specified path string.
Public methodStatic member GetFileName Returns the file name and extension of the specified path string.
Public methodStatic member GetFileNameWithoutExtension Returns the file name of the specified path string without the extension.
Public methodStatic member GetFullPath Returns the absolute path for the specified path string.
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public methodStatic member GetInvalidPathChars Gets an array containing the characters that are not allowed in path names.
Public methodStatic member GetPathRoot Gets the root directory information of the specified path.
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Public methodStatic member HasExtension Determines whether a path includes a file name extension.
Public methodStatic member IsPathRooted Gets a value indicating whether the specified path string contains a root.
Public method ToString Returns a string that represents the current object. (Inherited from Object.)

Top

Fields

  Name Description
Public fieldStatic member DirectorySeparatorChar Provides a platform-specific character used to separate directory levels in a path string that reflects a hierarchical file system organization.
Public fieldStatic member InvalidPathChars Provides a platform-specific array of characters that cannot be specified in path string arguments passed to members of the Path class.

Top

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

System.IO Namespace