"JS" <(E-Mail Removed)> wrote in
news:bG1Ed.1994$(E-Mail Removed):
> Does anybody know how I can get the just the selected directory
> from an OpenFileDialogBox?
>
> I have tried GetDirectoryName and GetFullPath, but these two
> require that I manually input in the code the directory I'm
> trying to retrieve. What I'm trying to do is allow the user to
> select a multiple files (which works fine) and be able to tell
> which directory the selected files came from.
>
> I thought that this would be an easy thing to do but, I cannot
> find any solutions to this anywhere in the newsgroups or google.
JS,
The path can be retrieved from one of the selected files:
string path;
if (_openFileDialog.FileNames.Length > 0)
path = Path.GetDirectoryName(_openFileDialog.FileNames[0]);
--
Hope this helps.
Chris.
-------------
C.R. Timmons Consulting, Inc.
http://www.crtimmonsinc.com/