Computing.Net > Forums > Programming > VB9 last string

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

VB9 last string

Reply to Message Icon

Name: wille
Date: April 14, 2008 at 04:37:52 Pacific
OS: WINDOWS XP Home Eidition
CPU/Ram: 3.2GHz
Comment:

Hello. I'm having some trouble with this string, well path. When the user of this program that I'm creating has entered a path to a picture, using an openfiledialog I need to extract only the filename from that string. Ex:
say openfiledialog1.filename = "C:\folder\anotherfolder\somefile.txt" then I need the "somefile.txt" from that string including the .txt especially. I get the feeling I missing out on something easy here. Help plz
thanks in advance

Live the life as you know it
/ Wille



Sponsored Link
Ads by Google

Response Number 1
Name: Razor2.3
Date: April 14, 2008 at 17:16:28 Pacific
Reply:

Well, .NET 2.0 SP1 and on has a OpenFileDialog.SafeFileName().

If that's not an option, the linked page suggests using Path.GetFileName():

SafeFileName = Path.GetFileName(ofd.FileName.ToString())


0

Response Number 2
Name: wille
Date: April 15, 2008 at 12:48:07 Pacific
Reply:

Yeah thanks alot! That helpt thanks!

Live the life as you know it
/ Wille


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: VB9 last string

c++ combine strings www.computing.net/answers/programming/c-combine-strings/13746.html

Batch, Insert String www.computing.net/answers/programming/batch-insert-string/18882.html

C++ help www.computing.net/answers/programming/c-help-/5644.html