Private Sub Command1_Click() Dim fso As New FileSystemObject, f As File Set f = fso.GetFile("c:\temp.txt") MsgBox f.Size & " byte" End Sub
strOpenFileName = frmMDI.CMDialog.Filename ' 如果文件大于 65K,则不能打开文件,取消操作。 ' If FileLen(strOpenFileName) > 65000 Then ' MsgBox "文件太大,无法打开。" ' Exit Function ' End If
Dim fso As New FileSystemObject, f As File
Set f = fso.GetFile("c:\temp.txt")
MsgBox f.Size & " byte"
End Sub
' 如果文件大于 65K,则不能打开文件,取消操作。
' If FileLen(strOpenFileName) > 65000 Then
' MsgBox "文件太大,无法打开。"
' Exit Function
' End If
FSO 或
FileLen 函数。
要不就用api
先
CreateFIle
GetFileSize