Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

C# Browse for Directory File Dialog

Posted on 2003-03-04
9
Medium Priority
?
30,018 Views
Last Modified: 2011-08-18
Is there property I can set so that I can use the open file dialog to select only a directory?  Or is there a similar control I can use?  ( I seem to remember doing in VB, is there an a similar method )

I want the control so that users can navigate and set an output directory.

Thanks
0
Comment
Question by:gameros
7 Comments
 

Accepted Solution

by:
Bulls earned 100 total points
ID: 8071612
Hi

You need to use a treeview, but you'll have to populate it yourself, I've got some code that does that, if you want it.

Cheers
0
 

Author Comment

by:gameros
ID: 8072730
I'll look into using the treeview.

I know VB has the FileSystemObject, is there anything similar in C#?
0
 
LVL 3

Assisted Solution

by:WiB
WiB earned 100 total points
ID: 8074191
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 70

Expert Comment

by:Éric Moreau
ID: 8075357
0
 

Expert Comment

by:CoronaB
ID: 8084042
Try this.....

Shell32.ShellClass shell = new Shell32.ShellClass();
Shell32.Folder2 folder = (Shell32.Folder2)shell.BrowseForFolder(this.Handle.ToInt32(),"Select Folder...",0,Shell32.ShellSpecialFolderConstants.ssfDESKTOP);
try{theTextBox.Text = folder.Self.Path;}
catch{}

You will have to add the Microsoft Shell controls and automation reference to your project
0
 
LVL 6

Expert Comment

by:martinv
ID: 8333904
Try native Browse Folder Dialog from Gengis project

http://www.sellsbrothers.com/tools/genghis/

screenshot: http://www.sellsbrothers.com/tools/genghis/screenshots/FolderBrowser.JPG

It's free and open source...


Martin Vobr
http://www.rebex.net/ftp.net/
0
 

Expert Comment

by:arilian
ID: 23133079
Use the FolderBrowserDialog()

0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Kernel Data Recovery is a renowned Data Recovery solution provider which offers wide range of softwares for both enterprise and home users with its cost-effective solutions. Let's have a quick overview of the journey and data recovery tools range he…
Suggested Courses

578 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question