469,296 Members | 2,102 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,296 developers. It's quick & easy.

get only fileName from OpenFileDialog

144 100+
hello,

i find that if i use the OpenFileDialog1.fileName, i get the fullpath + the name of the file selected by the user.

how to get only the filename and its extension but without the path to the file?

Thank you.
Oct 20 '09 #1

✓ answered by tlhintoq

Take a look on the MSDN for System.IO.Path namespace.
It has a lot of methods for .GetFileName() .GetFileNameWithoutExtension() and so on.

http://msdn.microsoft.com/en-us/libr...h_methods.aspx

2 6265
tlhintoq
3,525 Expert 2GB
Take a look on the MSDN for System.IO.Path namespace.
It has a lot of methods for .GetFileName() .GetFileNameWithoutExtension() and so on.

http://msdn.microsoft.com/en-us/libr...h_methods.aspx
Oct 20 '09 #2
thesti
144 100+
hi!,

thanks tlhintoq. i'll give it a try.
Oct 21 '09 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Koala Beer | last post: by
2 posts views Thread by Hrcko | last post: by
5 posts views Thread by Petrosky | last post: by
6 posts views Thread by SpreadTooThin | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by harlem98 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.