C # Gets the file extension, file name and path

An existing file path:   localFilePath = "C: \ the Users \ yhood \ Desktop \ Bureau attendance 06.xlsx"

  String Directory = Path.GetDirectoryName (localFilePath);   
  // file where the path C: \ the Users \ yhood \ Desktop String filename = Path.GetFileNameWithoutExtension (localFilePath);
  // file name Forestry attendance 06 String Extension = Path.GetExtension (localFilePath) ;
  // file suffix little .xlsx (.)

 

Guess you like

Origin www.cnblogs.com/yhood/p/11525922.html