Obtaining only the filename when using OpenFileDialog property "FileName"
Use OpenFileDialog.SafeFileName
OpenFileDialog.SafeFileName
Gets the file name and extension for the file selected in the dialog box. The file name does not include the path.
Use: Path.GetFileName Method
var onlyFileName = System.IO.Path.GetFileName(ofd.FileName);