C# string path get File extension code example
Example 1: csharp file extension
// .CS is C#'s file extension, although (on windows)
// the final output will result in the form of a .EXE or a .DLL
Example 2: c# get file extension
string myFilePath = @"C:\MyFile.txt";
string ext = Path.GetExtension(myFilePath);
// ext would be ".txt"