01 October 2012

Get Filename without path/extension

All versions of .Net since 2002 (the first version) has the System.IO.Path namespace that is OS independent, meaning if it's running on Mono (linux or Mac, both of which don't use a "\" as the separater character) it'll still work!
System.IO.Path.GetExtension()
System.IO.Path.GetFileName()
System.IO.Path.GetFileNameWithoutExtension()

Trovato qui.