Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

39,845 questions

51,766 answers

573 users

How to get all the files and their lengths from a directory in windows with VB.NET

1 Answer

0 votes
Imports System.IO

Module Module1

    Sub Main()

        Dim dir As String = "d:\source\_working_frame\"

        Dim files() As String = Directory.GetFiles(dir)

        For Each element As String In files
            Console.WriteLine("{0} {1}b", element, New FileInfo(element).Length)
        Next

    End Sub

End Module


' run:
' 
' d:\source\_working_frame\link.res 25092b
' d:\source\_working_frame\output.txt 0b
' d:\source\_working_frame\sqlite3.dll 599419b
' d:\source\_working_frame\wf.exe 16046234b
' d:\source\_working_frame\wf.ico 137040b
' d:\source\_working_frame\wf.lpi 2855b
' d:\source\_working_frame\wf.lpr 365b
' d:\source\_working_frame\wf_main.compiled 495b
' d:\source\_working_frame\wf_main.lfm 2698b
' d:\source\_working_frame\wf_main.pas 8237b
' d:\source\_working_frame\workingframe.sqlite 98304b
' ...

 



answered Oct 18, 2018 by avibootz
...