Click here to Skip to main content
15,887,676 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi ,

Can any one guide me how to create a file Explorer in winforms


My requirement is i want a tree view to display all the directortes in the directories in the system and on clicking the particular folder in the tree view i want to display all the text files with size and date in the list view including the icons .

Can any one guide me how to do this.

Thanks in Advance.

Thanks and Regards,
Aditya Kiran M.
Posted
Updated 23-Apr-11 8:31am
v3

1 solution

I would suggest you start by looking at the System.IO namespace with specific reference to the File and Directory classes. The static methods of the Directory class include GetDirectories (which will return top level or all sub directories of a directory you specify) and also GetFiles which will return all the file names of a directory. Between these two functions it should be pretty simple to write a loop that just loops through sub directories adding them to a tree view and then on clicking a directory simply use GetFiles and filter which ones you add the a list view. You can also use the FileInfo class to get more information about a file by: new FileInfo(Filename) which can tell you things like file extension, file size, created date etc.

Hope this helps,

Ed :)
 
Share this answer
 
Comments
aditya kiran maroju 23-Apr-11 15:15pm    
how to get the icon images of the file system and display in the list view?
Ed Nutting 23-Apr-11 15:35pm    
I would suggest you google this question. It is almost undoubtedly possible. Try asking Googling the question literally or look at Windows API and Classes section of the registry. Hope this helps, Ed :)
aditya kiran maroju 25-Apr-11 13:08pm    
Hi thank you for your guidance.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900