Home All Groups Group Topic Archive Search About
Author
11 Aug 2006 5:27 PM
Laserson
Hi all! For example i have a open file dialog called "Dialog_Open" and i
use following code:

If Dialog_Open.ShowDialog=DialogResult.Ok Then
Label_FileName.Text=Dialog_Open.FileName
End If

but FileName returns the full path of file, but i need only opened file
name and extension, for example not "C:\Sample\ReadMe.txt", but
"ReadMe.txt". How to do that?

Author
11 Aug 2006 5:50 PM
Michael D. Ober
Take a look at the system.io.path class.

Mike Ober.

Show quoteHide quote
"Laserson" <laser***@yandex.ru> wrote in message
news:e0sp7tWvGHA.4384@TK2MSFTNGP04.phx.gbl...
> Hi all! For example i have a open file dialog called "Dialog_Open" and i
> use following code:
>
> If Dialog_Open.ShowDialog=DialogResult.Ok Then
> Label_FileName.Text=Dialog_Open.FileName
> End If
>
> but FileName returns the full path of file, but i need only opened file
> name and extension, for example not "C:\Sample\ReadMe.txt", but
> "ReadMe.txt". How to do that?
Author
11 Aug 2006 6:36 PM
zacks
Michael D. Ober wrote:
> Take a look at the system.io.path class.

Or the File Info class.

Show quoteHide quote
>
> Mike Ober.
>
> "Laserson" <laser***@yandex.ru> wrote in message
> news:e0sp7tWvGHA.4384@TK2MSFTNGP04.phx.gbl...
> > Hi all! For example i have a open file dialog called "Dialog_Open" and i
> > use following code:
> >
> > If Dialog_Open.ShowDialog=DialogResult.Ok Then
> > Label_FileName.Text=Dialog_Open.FileName
> > End If
> >
> > but FileName returns the full path of file, but i need only opened file
> > name and extension, for example not "C:\Sample\ReadMe.txt", but
> > "ReadMe.txt". How to do that?