Skip to content

Path

Path is a static class that provides a series of methods for manipulating string paths, including creating, manipulating, and converting paths.

静态方法

Path.MatchExtension ( path : string , ext : string , ignore_case : boolean? ) : boolean
Check if the specified path has the current extension.
Path.NormalizePath ( path : string ) : string
Standardizes the specified path.
Path.GetDirectoryName ( path : string ) : string
Returns the directory name of the specified path.
Path.ChangeExtension ( path : string , ext : string ) : string
Change the extension of the specified path.
Path.GetExtension ( path : string ) : string
Returns the extension of the specified path.
Path.GetFullPath ( path : string ) : string
Returns the absolute path of the specified path.
Path.GetPathRoot ( path : string ) : string
Returns the root directory of the specified path.
Path.GetFileName ( path : string ) : string
Returns the file name (including the extension) of the specified path.
Path.GetTempFileName ( ) : string
Returns the file name of the temporary file.
Path.GetFileNameWithoutExtension ( path : string ) : string
Returns the file name (excluding the extension) of the specified path.
Path.GetTempPath ( ) : string
Returns the system temporary path directory.
Path.GetRandomFileName ( ) : string
Returns a random file name.
Path.HasExtension ( path : string ) : boolean
Check if the specified path has an extension.
Path.IsPathRooted ( path : string ) : boolean
Determine whether the specified path is an absolute path.
Path.IsRelative ( path : string ) : boolean
Check if the specified path is a relative path.
Path.GetRelativePath ( relTo : string , path : string ) : string
Returns the relative path from the initial path to the target path.