OpenFileDialogue question

  • Thread starter Thread starter PJ6
  • Start date Start date
P

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
 
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
 
Michael Bosch said:
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'.
 
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".
 
Back
Top