FileSize - HowTo

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



I get a list of filenames from a directory with the following code, but
I can not work out how to get the filesize of the filename I have just
found.

I guess it is fileinfo.length, but I can not see how to turn my
filename(string) into a statement which would give me the filesize -
the brain is very slow today. Any help gratefully appreciated.

Dim files() As String = System.IO.Directory.GetFiles(root,
patt)
dim filename as string
Dim f As String
For Each f In files
filename = System.IO.Path.GetFileName(f)
DropDownList1.Items.Add(filename)
..... GET FILESIZE OF ABOVE FILE and add to array
filesizes
Next

.



Relevant Pages

  • how to find a spool file by VBA???????????
    ... I have to wait untill the spool process il finished.. ... Dim pauseDuration As Single ... Dim fileSize As Long ... Public Function Read_registry_Value(ByVal KeyName As String) As String ...
    (microsoft.public.office.developer.vba)
  • Re: FileSize - HowTo
    ... dim fi as new FileInfo ... FileSize = fi.Length ... I can not work out how to get the filesize of the filename I have just ... Dim filesAs String = System.IO.Directory.GetFiles(root, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: FileSize - HowTo
    ... dim fi as new FileInfo ... FileSize = fi.Length ... I can not work out how to get the filesize of the filename I have just ... Dim filesAs String = System.IO.Directory.GetFiles(root, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: FileSize - HowTo
    ... I can not work out how to get the filesize of the filename I have just ... Dim files() As String = System.IO.Directory.GetFiles(root, ...
    (microsoft.public.dotnet.framework.aspnet)
  • adding values to fields
    ... With the code below i can manage to add the filename to the first ... but i cant get it done to add the filesize in to the second ... Private Sub btnMove_Click(ByVal sender As System.Object, ...
    (microsoft.public.dotnet.languages.vb)