C# 获取文件的后缀,文件名和路径

现有一个文件路径为:  localFilePath=”C:\Users\yhood\Desktop\林业局考勤06.xlsx“

  string directory = Path.GetDirectoryName(localFilePath);  
//文件所在路径      C:\Users\yhood\Desktop string filename = Path.GetFileNameWithoutExtension(localFilePath);
//文件名    林业局考勤06 string extension = Path.GetExtension(localFilePath);
//文件后缀 带点(.)     .xlsx