.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month

Home >> Code Snippets >> File Operation >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Calculating the Size of folder

Posted By:balram       Posted Date: March 15, 2010    Points: 10    Category: File Operation    URL: http://www.dotnetspark.com  

Calculating the Size of any given folder of System .

 Private Function GetFolderSize(ByVal FolderName As String) As Long
        Dim d As New DirectoryInfo(FolderName)
        Dim TotalSize As Long = 0
        For Each s As String In Directory.GetFiles(d.FullName, "*.*", SearchOption.AllDirectories)
            TotalSize += New FileInfo(s).Length
        Return TotalSize
    End Function


Further Readings:


No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply

    Read also another Resources from the same Author

Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend