Click here to Skip to main content
15,890,186 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
C#
Requirements –
1)	User to be able to browse & select folders 
2)	Run the analysis (there must be a run button)
3)	A sample dashboard should display total folders, size and % of space, # of files and # of folders inside each folder, Last modified date
4)	Bar chart of folder size





What I have tried:

I am able to list down the folders present within a drive but don't know how to get all attributes like folder size , count of folders ,percentage of total space etc.
Posted
Updated 1-Sep-16 4:50am
v2
Comments
[no name] 1-Sep-16 10:19am    
First thing you need to do is decide if you are creating a Windows Form project or an ASP.NET project. It can't be both like you seem to think it is.
dinesh kumar 1-Sep-16 10:32am    
i am creating window form application in visual c# , just started today.
Please suggest what is the better way to design a tool which fullfills all requirements mentioned above.

Since i am new to .net, anything will fine for me :)
[no name] 1-Sep-16 10:36am    
A "better way" than what? Learning C# would be a good start.
dinesh kumar 1-Sep-16 10:39am    
just tell me one thing now i am able to list tree view for a drive but just thinking how to get other attributes like folder size , last modified, count of folders etc ? Pls give me some basic idea on this.
[no name] 1-Sep-16 10:53am    
Start by reading the documentation for the FileInfo class. and the DirectoryInfo class.

1 solution

have a read of these

FolderBrowserDialog Class (System.Windows.Forms)[^]

c# - how to list all sub directories in a directory - Stack Overflow[^]

Directory.GetFiles Method (String) (System.IO)[^]

FileInfo.Length Property (System.IO)[^]

All of these pages / code examples should get you started on fulfilling your requirements. If you get stuck please comeback and ask a question and we will help as much as we can, but were not going to do the project for you.
 
Share this answer
 
Comments
dinesh kumar 1-Sep-16 11:40am    
Hi Simon , Thanks for all the links you mentioned above.
All the links given above have given example of console application but i am working on Window form application .

Please guide.Thanks in advance.
Simon_Whale 1-Sep-16 11:43am    
You can apply those examples in a win forms application you just have to decide on how you want the information to be displayed. For example you could have a button that opens the folderdialog and when the user has chosen the folder that they want to analyse then that location is then put into a text box.
dinesh kumar 21-Sep-16 13:45pm    
Hi Simon.....I have developed my application with the help of above links provided by you. But still facing one issue...

Actually we will be using this tool for one of our network drive which have size around 54TB. With this technique it's taking a long..is there any other way by which I can get desired result in min time ?
Simon_Whale 22-Sep-16 4:02am    
I would start by looking at what part of your application is consuming the most time. I suspect it may be the time that you need to traverse the file structure
dinesh kumar 14-Oct-16 8:27am    
Yes Simon you are right....traversing the drive which is too long in size is taking long with file info class

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