At my end everything works perfectly fine…
“File” is data type “System.io.fileinfo”
It has propperty “Name” that holds the name of the file.
Using the “Substring” method is the retrieved the file name without extension.
Personally, I would rather use following method to get the file name wihtout extension.
FileName = path.GetFileNameWithoutExtension(File.Name)
Cheers