Hi,

how can i open and show a folder in windows using C#. like after complting some task i want the app to open the particular folder and present it to the user.

like we open any folder by double clicking on it. I want to do it the same thru code

thx

You can use the OpenFileDialog or FolderBrowserDialog from the toolbox.

You can use the OpenFileDialog or FolderBrowserDialog from the toolbox.

i'm already using that in my program. But I couldn't figure out how I can open and show the folder to the user, not in my program and not for file selecting or browsing folders;

Ok in short this is what the program does

1. Ask the user to browse folder
2. Read all the files within the folder
3. check files for integrity
4. and then finishes

Now I want to do

5. Show the folder to the user in which the processing was done. i.e. open that folder in windows. thats it

I hope i'm clear now

thx

You make it perfectly clear!
OpenFileDialog has a property called InitialDirectory, feed it the folder the user was browsing, is this what you want?
Or do you want to take your app to the background, to manipulate XP? Vista? to open a FileDialog for the folder which your app was manipulating?

You make it perfectly clear!
OpenFileDialog has a property called InitialDirectory, feed it the folder the user was browsing, is this what you want?
Or do you want to take your app to the background, to manipulate XP? Vista? to open a FileDialog for the folder which your app was manipulating?

Yes, I want the later case

to take my app to the background, to manipulate XP? Vista? to open a FileDialog for the folder which your app was manipulating?

so the app can sshow the user which files in the folder were processed.

No, Danny they need to do that System.Diagnostics.Process.Open("DirectoryPath"); C# Sample

System.Diagnostics.Process.Open("C:\\Windows");

Thanks for pointing this out Ramy!
Did not know this.:-/

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.