By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,815 Members | 1,142 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,815 IT Pros & Developers. It's quick & easy.

OpenFileDialog1

P: n/a

Hey guys i'm using the OpenFileDialog1.filename.

the problem is that it gives me the full path of the
file, ex:

c:\Program Files\SomeFolder\somepic.gif.

i only need the somepic.gif part,not the full path. what
do i do ?!?!

thanx !
Nov 20 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
* "Will" <an*******@discussions.microsoft.com> scripsit:
Hey guys i'm using the OpenFileDialog1.filename.

the problem is that it gives me the full path of the
file, ex:

c:\Program Files\SomeFolder\somepic.gif.

i only need the somepic.gif part,not the full path. what
do i do ?!?!


Have a look at the 'System.IO.Path' class and its shared members
('Get*').

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2

P: n/a
thats not really what i was looking for, i wanted
something in the OpenFileDialpg1. (a member)
-----Original Message-----
* "Will" <an*******@discussions.microsoft.com> scripsit:
Hey guys i'm using the OpenFileDialog1.filename.

the problem is that it gives me the full path of the
file, ex:

c:\Program Files\SomeFolder\somepic.gif.

i only need the somepic.gif part,not the full path. what do i do ?!?!
Have a look at the 'System.IO.Path' class and its shared

members('Get*').

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
.


Nov 20 '05 #3

P: n/a
"Will" <an*******@discussions.microsoft.com> schrieb

Hey guys i'm using the OpenFileDialog1.filename.

the problem is that it gives me the full path of the
file, ex:

c:\Program Files\SomeFolder\somepic.gif.

i only need the somepic.gif part,not the full path. what
do i do ?!?!

System.IO.Path.GetFileName
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #4

P: n/a
* "Will" <an*******@discussions.microsoft.com> scripsit:
thats not really what i was looking for, i wanted
something in the OpenFileDialpg1. (a member)


\\\
MsgBox(System.IO.Path.GetFileName(OpenFileDialog1. FileName))
///

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.