string FilePath [email protected] "e:/randy0528/Chinese catalog/justtest.rar";
Change the extension of the path string.
System.IO.Path.ChangeExtension (FilePath, "txt");
e:/randy0528/Chinese Catalogue/justtest.txt
Returns the directory information for the specified path string.
System.IO.Path.GetDirectoryName (FilePath);
e:/randy0528/Chinese Catalog
Returns the extension of the specified path string.
System.IO.Path.GetExtension (FilePath);
. rar
Returns the file name and extension of the specified path string.
System.IO.Path.GetFileName (FilePath);
Justtest.rar
Returns the file name of the specified path string that does not have a name extension.
System.IO.Path.GetFileNameWithoutExtension (FilePath);
Justtest
Gets the root directory information for the specified path.
System.IO.Path.GetPathRoot (FilePath);
e:/
Returns the random folder name or file name.
System.IO.Path.GetRandomFileName ();
Ct2h5b2h.sed
Creates a uniquely named 0-byte temporary file on the disk and returns the full path of the file.
System.IO.Path.GetTempFileName ();
C:/Documents and Settings/randy/local settings/temp/tmpad.tmp
Returns the path to the temporary folder for the current system.
System.IO.Path.GetTempPath ();
C:/Documents and Settings/randy/local settings/temp/
Determines whether the path includes a file name extension.
System.IO.Path.HasExtension (FilePath);
True
Gets a value that indicates whether the specified path string contains absolute path information or contains relative path information.
System.IO.Path.IsPathRooted (FilePath);
True
Reprint: http://blog.csdn.net/chanyinhelv/article/details/8432840
System.IO.Path file name, path, extension processing