String filePath = @ "E:\Randy0528\ Chinese catalog \justtest.rar";
Response.Write ("File path:" +filepath);
Response.Write ("<br/> Change the extension of the path string. <br/> ");
Response.Write (System.IO.Path.ChangeExtension (FilePath, "txt"));
Response.Write ("<br/> returns directory information for the specified path string: <br/> ");
Response.Write (System.IO.Path.GetDirectoryName (FilePath));
Response.Write ("<br/> returns the extension of the specified path string. <br/> ");
Response.Write (System.IO.Path.GetExtension (FilePath));
Response.Write ("<br/> returns the file name and extension of the specified path string. <br/> ");
Response.Write (System.IO.Path.GetFileName (FilePath));
Response.Write ("<br/> returns the file name of the specified path string that does not have an extension.) <br/> ");
Response.Write (System.IO.Path.GetFileNameWithoutExtension (FilePath));
Response.Write ("<br/> Gets the root directory information for the specified path. <br/> ");
Response.Write (System.IO.Path.GetPathRoot (FilePath));
Response.Write ("<br/> returns a random folder name or a file name.) <br/> ");
Response.Write (System.IO.Path.GetRandomFileName ());
Response.Write ("<br/> creates a uniquely named 0-byte temporary file on disk and returns the full path of the file. <br/> ");
Response.Write (System.IO.Path.GetTempFileName ());
Response.Write ("<br/> returns the path of the current system's Temp folder. <br/> ");
Response.Write (System.IO.Path.GetTempPath ());
Response.Write ("<br/> determines whether the path includes a file name extension.) <br/> ");
Response.Write (System.IO.Path.HasExtension (FilePath));
Response.Write ("<br/> gets a value that indicates whether the specified path string contains absolute path information or contains relative path information.) <br/> ");
Response.Write (System.IO.Path.IsPathRooted (FilePath));
File path: E:\Randy0528\ Chinese directory \justtest.rar
Change the extension of the path string.
E:\Randy0528\ Chinese Catalogue \justtest.txt
Returns directory information for the specified path string:
E:\Randy0528\ Chinese Catalog
Returns the extension of the specified path string.
. rar
Returns the file name and extension of the specified path string.
Justtest.rar
Returns the file name of the specified path string that does not have a name extension.
Justtest
Gets the root directory information for the specified path.
E:\
Returns the random folder name or file name.
Ct2h5b2h.sed
Creates a uniquely named 0-byte temporary file on the disk and returns the full path of the file.
C:\Documents and Settings\randy\local settings\temp\tmpad.tmp
Returns the path to the temporary folder for the current system.
C:\Documents and Settings\randy\local Settings\temp\
Determines whether the path includes a file name extension.
True
Gets a value that indicates whether the specified path string contains absolute path information or contains relative path information.
True
"Go" C # some operations on a path