FolderBrowserDialog() question about network paths.

O

OregonMike

With the code snippet below, when prompted w/ the FolderDialogBrowser
Form if the user selects an entry from "My Network Places" the
folderBrowser.SelectedPath returned points to the local shortcut
file's location (eg. "C:\Documents And Settings\User4\NetHood\Src on
Server4") and not the chosen network location's path ("\\Server4\Src
\"). Besides that functionality being very unintuitive, how would one
actually get the selected network folder's UNC path w/o tapping into
Interop stuff?

Thanks,
-Mike


Dim srcDir As String

Using folderBrowser As New FolderBrowserDialog()
folderBrowser.Description = "Select the directory of your sources."
If (folderBrowser.ShowDialog() = Windows.Forms.DialogResult.OK)
Then
srcDir = folderBrowser.SelectedPath
End If
End Using
 
G

G Himangi

This seems to be a bug. You could try parsing the string "src on Server4"
and determine the actual UNC from this string, but I am not comfortable with
this.

---------
- G Himangi, LogicNP Software http://www.ssware.com
Shell MegaPack: Controls For Windows Explorer like File/Folder Browser
Functionality in your apps(.Net & ActiveX Editions).
EZNamespaceExtensions: Develop namespace extensions rapidly in .Net and
MFC/ATL/C++
EZShellExtensions: Develop all shell extensions,explorer bars and BHOs
rapidly in .Net & MFC/ATL/C++
 
Top