Skip to content

Navigating using the Libraries shortcut causes the dialog's Path property to fill with garbage #1

Description

@rossmurray

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.

Example outputs:

޾拀޼
≐޾䬠޷怂麌곫
Ũ߁߂
Ⅰश㭸߀
摸߁�޿Volume{b3217025-7d33-11e0-895c-806e6f6e6963}\
岐࠭㰘࠷SERSPROFILE=C:\ProgramData

My project is .NET 4.0 and I'm using Visual Studio 2010. My OS is Windows 7 Professional 64-bit

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions