天天看點

VB程式設計:FileLen函數擷取檔案的大小

Private Sub Command1_Click()

   CommonDialog1.ShowOpen                           '打開對話框

   If CommonDialog1.FileName <> "" Then        '判斷檔案名是否為空

       Label1.Caption = "您打開的檔案大小為:" & FileLen(CommonDialog1.FileName) & "位元組"

                                                                             'FileLen顯示檔案長度

   End If

End Sub

備注:需要添加CommonDialog控件

繼續閱讀