VB 如何判断dir1.path 路径中是否有指定文件夹名

例 判断dir1.path 路径中是否有文件夹名books有提供正确者加分!
2025-01-01 04:46:08
推荐回答(2个)
回答1:

Private Sub Command1_Click()
MsgBox IIf(Dir(Dir1.Path & "\books", vbDirectory) <> "", "有", "无"), vbInformation
End Sub

回答2:

代码写好了,你试试看!!!

Private Sub Command1_Click()
If Dir(dir1.Path & "\book") <> "" Then
MsgBox "ok"
End If
End Sub