Best ways to list files

  • Thread starter Thread starter Jason
  • Start date Start date
J

Jason

Um i am trying to make a program for my school and i need a way to scan
the entire drive such as C drive and find all the files with specific
extensions... i think i know a way but its way too complex and long...
haha thank you if you can help :D

E mail: (e-mail address removed)
 
Option Explicit On
Option Strict On
Imports System
Imports System.IO
Class DirectoryLister
Public Shared Sub Main()
Dim dir As New DirectoryInfo(".")
Dim f As FileInfo
For Each f In dir.GetFiles("*.cs")
Dim name As [String] = f.FullName
Dim size As Long = f.Length
Dim creationTime As DateTime = f.CreationTime
Console.WriteLine("{0,-12:N0} {1,-20:g} {2}", size,
creationTime, name)
Next f
End Sub
End Class

http://www.mycodebank.com/Snippet,139.aspx
 
Back
Top