const string filePath = @"D:/aa/bb/cc.txt";
string strCurentPath = Process.GetCurrentProcess().MainModule.FileName; //运行程序的当前路径
string strDir = System.IO.Path.GetDirectoryName(filePath); //返回路径 "D://aa//bb"
string strExtensionName = System.IO.Path.GetExtension(filePath); //返回后缀名 .txt
string strFileName = System.IO.Path.GetFileName(filePath); //返回指定路径字符串的文件名和扩展名 "cc.txt"
string strPathRoot = System.IO.Path.GetPathRoot(filePath); //获取指定路径的根目录信息 "D://"
string strRanFileName = System.IO.Path.GetRandomFileName(); //返回随机文件夹名或文件名 "yulh0wit.4kr"
string strWithoutExPath = System.IO.Path.GetFileNameWithoutExtension(filePath);
//返回不具有扩展名的指定路径字符串的文件名 cc
string strChangeExtension = System.IO.Path.ChangeExtension(filePath, "mp3");
//改变文件名的后缀,如果没有后缀名就加上指定的后缀名 "D://aa//bb//cc.mp3"
string strTempFileName = System.IO.Path.GetTempFileName();
//创建磁盘上唯一命名的零字节的临时文件并返回该文件的完整路径
string strTempPath = System.IO.Path.GetTempPath();
//返回当前系统的临时文件夹的路径 "C://Documents and Settings//Administrator//Local Settings//Temp//"
bool iHasExtension = System.IO.Path.HasExtension(filePath);
//确定路径是否包括文件扩展名 有返回 true 没有 false
bool iHasRooted = System.IO.Path.IsPathRooted(filePath);
//获取一个值,该值指示指定的路径字符串是包含绝对路径信息还是包含相对路径信息 有“//” 返回 true 没有 fals