VB编程:FileLen函数获取文件的大小
- Private Sub Command1_Click()
- CommonDialog1.ShowOpen '打开对话框
- If CommonDialog1.FileName <> "" Then '判断文件名是否为空
- Label1.Caption = "您打开的文件大小为:" & FileLen(CommonDialog1.FileName) & "字节"
- 'FileLen显示文件长度
- End If
- End Sub
备注:需要添加CommonDialog控件