Skip to main content
gamedev.net
🔒 Locked

WinForms - OpenFileDialog

Started by daniel_i_l 0 replies 500+ views
Original Post
daniel_i_l
daniel_i_l
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
Skizz
Skizz
Use:

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

Skizz

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.