Tuesday, May 5, 2009

How to check the file size in vb6.0?

can anybody tell me how to check the file size in vb 6.0????

1 comment:

  1. just open a new project and follow the instructions below.


    'File Size
    ' add a label named lblfilesize and a command button named as BtnShow

    Private Sub BtnShow _Click()
    Call ShowFileSize()

    End Sub


    Private Sub ShowFileSize()
    Dim strFile As String
    Dim strSize As String
    Dim strMyDir As String
    Dim strMyFile As String

    strMyDir = "c:"
    strMyFile = "abc.txt"

    strFile = strMyDir & "\" & strMyFile
    strSize = FileLen(strFile)

    lblfilesize.Caption = "The file " & strFile & " is " & _
    Format(strSize, "#,##0") & "Bytes in size."

    End Sub

    ReplyDelete