string filePath = "C:\temp\myfile.txt"; string fileName = Path.GetFileName(filePath); // output: "myfile.txt"
string directoryPath = "C:\temp"; string fileName = "myfile.txt"; string filePath = Path.Combine(directoryPath, fileName); // output: "C:\temp\myfile.txt"
string filePath = "C:\temp\myfile.txt"; string fileExtension = Path.GetExtension(filePath); // output: ".txt"The Sharpen FilePath library is part of the .NET Standard Library and is included in the System.IO namespace.