FolderDialogBrower with Window 2000

B

Barry Pierce

I have created a simple program to open a
FolderDialogBrower box.

I'm trying to use the FileBrowserDialog to select a
network folder using UNC path names.

The only option that seems to work is to set
this.FolderBrowserDialog1.RootFolder =
System.Environment.SpecialFolder.DesktopDirectory
and
this.FolderBrowserDialog1.SelectedPath
= "\\Servername\..."

However, this only works with Windows XP
machines. When I try to open the FileBrowserDialog box
using Windows 2000, only the desktop directory opens
instead of the SelectedPath.

Any suggestions?
 
H

Herfried K. Wagner [MVP]

Hello,

Barry Pierce said:
I have created a simple program to open a
FolderDialogBrower box.

I'm trying to use the FileBrowserDialog to select a
network folder using UNC path names.

The only option that seems to work is to set
this.FolderBrowserDialog1.RootFolder =
System.Environment.SpecialFolder.DesktopDirectory
and
this.FolderBrowserDialog1.SelectedPath
= "\\Servername\..."

However, this only works with Windows XP
machines. When I try to open the FileBrowserDialog box
using Windows 2000, only the desktop directory opens
instead of the SelectedPath.

Does this even occur with the P/Invoke versions?

http://www.codeproject.com/cs/miscctrl/folderbrowser.asp
http://support.microsoft.com/?kbid=306285
http://www.gotdotnet.com/team/vb/FolderBrowser.exe
http://groups.google.com/groups?selm=q0JKzDbmCHA.2144@cpmsftngxa09

The FolderBrowserDialog is buggy on Windows 2000, for example, the property
for hiding the button "Create new folder" doesn't work on Windows 2000
machines.

HTH,
Herfried K. Wagner
 
B

Barry Pierce

I am trying to set the initial directory to be a UNC path
(e.g. \\servername\share1) instead of having to work my
way through Network Neighborhood.

I have looked at the FolderBrowser examples but am not
seeing a clear way to do this.

Is there a way to set the Intial Directory?


====================

40cpmsftngxa09
 
H

Herfried K. Wagner [MVP]

Hello,

Barry Pierce said:
I have looked at the FolderBrowser examples but am not
seeing a clear way to do this.

Is there a way to set the Intial Directory?

Did you try to set the FolderBrowserDialog's SelectedPath property?

HTH,
Herfried K. Wagner
 
B

Barry Pierce

Dear Herfried,

Thanks for your reply.

Yes, I tried the .Net 1.1 FolderBrowserDialog
SelectedPath property. However, this is what doesn't
work with Windows 2000 but does work with Windows XP.

I've tried the older version FolderBrowser code that you
referenced but have not yet figured out how to set the
initial directory to a UNC path. The examples that I have
found seem to be incomplete.


====================
Did you try to set the FolderBrowserDialog's
SelectedPath property?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top