❔ Hello I need some help with a recursion dirs & files tree in windows forms
I have the following function I can get the length (size of the current folder and show it )
but I need for each dir to enter the sub dir and also calc the size of them and not sure how to do it (Calc the files using length property),
so for every dir I need to calculate the whole dirs & files size sitting under it using rec
13 Replies
any help or maybe some guide to help me understand rec better is much appreciated
don't reinvent the wheel, use
Directory.EnumerateFiles()
and Directory.EnumerateDirectories()
from System.IO passing SearchOptions.AllDirectories
to itI have no idea how to use it 😦
its hw for school
but ill try to check thoose 2 now
Work with files and directories in a .NET app - Training
Learn how to use .NET, C#, and System.IO to work with directories, paths, files, and the file system.
take this 45 minutes estimated interactive course
will teach you everything about working with files and directories you gotta know in .net
sweet nice is it free
sure
thanks ill try it now
all docs.microsoft.com or learn.microsoft.com ressources arre free afaik
using the Directory Enumrate Files I can get he size of sub folders?
if all you care about is the whole folders' sizes then Directory.EnumerateDirectories should be enough tho
btw if your school hw includes creating the recursive algorithm yourself by hand, then you cant use my suggested approach
but at least you know how its done properly after this course 😄
yes that's most important
brain burnning
...........
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.