|
-
May 23rd, 2001, 09:21 AM
#1
Determining file size in VB
How do I determine the size of any file in a certain directory? (In VB 6.0)
-
May 23rd, 2001, 09:25 AM
#2
Re: Determining file size in VB
the filelen(filename) function will give up the size of the file
filedatetime will give the date and time last modified.
-
May 23rd, 2001, 09:33 AM
#3
Re: Determining file size in VB
'1 filelistbox
'1 command button
'select a file from file list box, then click on command button
Option Explicit
Private Sub Command1_Click()
Dim lngFileSize As Long
lngFileSize = FileLen(File1.FileName)
MsgBox "File Size: " & Format(lngFileSize, "###,###,### bytes")
End Sub
Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, Bruno Paris and all the other wonderful people who made and make Codeguru a great place. Come back soon, you Gurus.
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
-
May 23rd, 2001, 09:41 AM
#4
Re: Determining file size in VB
If it's an open file, you can use the LOF() function
open "test.txt" for binary as #1
msgbox LOF(1)
close #1
-
May 23rd, 2001, 09:57 AM
#5
Re: Determining file size in VB
Dim filesys,f As Object
Set filesys = CreateObject("Scripting.FileSystemObject")
Set f = filesys.GetFolder(folderpath)
Msgbox f.Size
Iouri Boutchkine
[email protected]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|