07
Jun
09

c# selecting a directory in an “open file” dialog



If you need to select a directory in an “open file” dialog, you can use the following code :


FolderBrowserDialog dialog = new FolderBrowserDialog();
dialog.ShowDialog();
string selected = dialog.SelectedPath;

The window will look like this :
dialog


5 Responses to “c# selecting a directory in an “open file” dialog”


  1. June 15, 2010 at 12:44

    thanks for sharing,,

  2. June 22, 2011 at 22:11

    not working in java

  3. January 30, 2012 at 16:56

    Lovely Lovely site ma. tHANKS For ur WordPress


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s


Blog Stats

  • 259,588 hits

%d bloggers like this: