vb6.0怎么判断计算机上的某个文件是否存在?

2025-03-13 23:42:21
推荐回答(3个)
回答1:

if dir("c:\1.txt")<>"" then msgbox "c:\1.txt 存在" else msgbox "c:\1.txt 不存在"

回答2:

Option Explicit

Private Sub Command1_Click()
If Dir("C:\WINDOWS\system32\roect", vbDirectory) <> "" Then
MsgBox "文件夹:C:\WINDOWS\system32\roect 存在!"
Else
MkDir "C:\WINDOWS\system32\roect"

End If
End Sub
用VB6.0测试过了没问题

回答3:

用input会出错