WinForms - OpenFileDialog

Started by
0 comments, last by Skizz 17 years, 7 months ago
I'm using the OpenFileDialog to open music files. After opening the file OpenFileDialog.FileName is set to the path of the file. I need the path to play the song but i would also like just the file name (without the path) to display in a playlist. How can i get the name without the path? Thanks.
"We've all heard that a million monkeys banging on a million typewriters will eventually reproduce the entire works of Shakespeare. Now, thanks to the internet, we know this is not true." -- Professor Robert Silensky
Advertisement
Use:

filename_only = System.IO.Path.GetFileName (filename_and_folder)

Skizz

This topic is closed to new replies.

Advertisement