vb代码中如何判断根目录下一个程序文件大小

来源:百度知道 编辑:UC知道 时间:2024/06/07 12:07:27
判断一个文件的大小,如果该文件大于5k就打开它,如果小于5k就删除它,具体代码要怎么写呀?

补充一下mosquitokobe的回答
删除文件用kill text1,即代码为

Private Sub Command1_Click()
If Dir(Text1) <> "" Then
If FileLen(Text1) / 1024 >= 5 Then
Shell Text1
else
kill Text1
End If

End If
End Sub

Private Sub Command1_Click()
If Dir(Text1) <> "" Then
If FileLen(Text1) / 1024 >= 5 Then
Shell Text1
Else
Kill Text1
End If
End If
End Sub

text里写文件路径