Home All Groups Group Topic Archive Search About

Best ways to list files

Author
17 Aug 2006 1:30 AM
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: Chung4***@aol.com

Author
17 Aug 2006 4:18 AM
Tips
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

Jason wrote:
Show quoteHide quote
> 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: Chung4***@aol.com