tags:

views:

165

answers:

3

I want a user to pick a directory to save image files too. I'm new to c#, I've got the image thing working with OpenFileDialog, how would I do the directory thing.

Basically, I want it to look like:

Save Directory: C:\PATH....

Maybe a FolderBrowserDialog or OpenDirectoryDialog?

Thanks for any help.

+5  A: 

Use the FolderBrowserDialog to select a folder, or use the SaveFileDialog to pick an individual file for saving.

Here is a codeplex.com example of using FolderBrowserDialog:

http://www.codeproject.com/KB/cs/csFolderBrowseDialogEx.aspx

kbrimington
A: 

you want the SaveFileDialog.

AllenG
+1  A: 

Use a FolderBrowserDialog. Here's an example:

FolderBrowserDialog brwsr = new FolderBrowserDialog();

//Check to see if the user clicked the cancel button
if (brwsr.ShowDialog() == DialogResult.Cancel)
    return;
else
{
    newDirectoryPath = brwsr.SelectedPath;
    //Do whatever with the new path
}
Mike Webb