When using the OpenFileOrFolderDialog to choose a file or folder, if you navigate to any of the folders contained in the "Libraries" in Windows 7, the Path property will contain garbage.
Here's my code:
using (var dialog = new OpenFileOrFolderDialog())
{
dialog.AcceptFiles = true;
if (dialog.ShowDialog() == DialogResult.OK)
{
textBox1.Text = dialog.Path;
}
}
To reproduce, run the above code. Select "Libraries" on the left pane of the dialog. Then navigate to Documents (Music, Videos, etc. work as well). Highlight a subdirectory inside of Documents and press the Select button. The Path property will contain some garbage.
When using the OpenFileOrFolderDialog to choose a file or folder, if you navigate to any of the folders contained in the "Libraries" in Windows 7, the Path property will contain garbage.
Here's my code:
To reproduce, run the above code. Select "Libraries" on the left pane of the dialog. Then navigate to Documents (Music, Videos, etc. work as well). Highlight a subdirectory inside of Documents and press the Select button. The Path property will contain some garbage.
Example outputs:
My project is .NET 4.0 and I'm using Visual Studio 2010. My OS is Windows 7 Professional 64-bit