Home All Groups Group Topic Archive Search About

OpenFileDialogue question

Author
12 May 2006 8:56 PM
PJ6
I just want the name of the file selected - I have no use for opening it up
in a stream.

Is there a built-in dialogue I can use to select a file, or do I need to
write my own? If so, are there any simple examples out there?

TIA,
Paul

Author
12 May 2006 9:05 PM
Michael Bosch
You would use the same OpenFileDialog, it exposes a property FileName which
will give you the full path/name of the file selected.  Or use FileNames if
you have multiselect set to true...

Regards,

Michael Bosch

Show quoteHide quote
"PJ6" <no***@nowhere.net> wrote in message
news:O7kVhagdGHA.4720@TK2MSFTNGP03.phx.gbl...
>I just want the name of the file selected - I have no use for opening it up
>in a stream.
>
> Is there a built-in dialogue I can use to select a file, or do I need to
> write my own? If so, are there any simple examples out there?
>
> TIA,
> Paul
>
Author
12 May 2006 10:10 PM
Herfried K. Wagner [MVP]
"Michael Bosch" <dotnetmich***@gmail.com> schrieb:
> You would use the same OpenFileDialog, it exposes a property FileName
> which will give you the full path/name of the file selected.  Or use
> FileNames if you have multiselect set to true...

ACK.  If you want to strip off the path and get the file name part only,
check out the shared methods of 'System.IO.Path'.

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>
Author
13 May 2006 4:14 PM
PJ6
I think I want to add a new word to the English language. One that means,
"when one looks for a property or method in an intellisense list, but for
some strange reason cannot find it even though it's plainly there".

Show quoteHide quote
"Michael Bosch" <dotnetmich***@gmail.com> wrote in message
news:CK69g.42209$Kn4.4784@bignews2.bellsouth.net...
> You would use the same OpenFileDialog, it exposes a property FileName
> which will give you the full path/name of the file selected.  Or use
> FileNames if you have multiselect set to true...
>
> Regards,
>
> Michael Bosch
>
> "PJ6" <no***@nowhere.net> wrote in message
> news:O7kVhagdGHA.4720@TK2MSFTNGP03.phx.gbl...
>>I just want the name of the file selected - I have no use for opening it
>>up in a stream.
>>
>> Is there a built-in dialogue I can use to select a file, or do I need to
>> write my own? If so, are there any simple examples out there?
>>
>> TIA,
>> Paul
>>
>
>