1) if len(dir(file)) then 文件存在 else 文件不存在2) on error goto fileerr open file for input as #1 文件存在 goto Exit fileerr: 文件不存在 exit: close #13) API: CreateFile, OpenFile
as james0001, especially 1) if len(dir(file)) then 文件存在 else 文件不存在
If Len(Dir("c:\windows\*.*")) > 0 Then MsgBox "目录已经存在" Else MsgBox "目录不存在" End If
open file for input as #1
文件存在
goto Exit
fileerr:
文件不存在
exit:
close #13) API:
CreateFile, OpenFile
MsgBox "目录已经存在"
Else
MsgBox "目录不存在"
End If