VB6 检测文件是否存在,子程序f_FileExist(strFN As String)新建From1(窗体),新建Command1(按钮CommandButton),代码:
Function f_FileExist(strFN As String) As Boolean
    If Dir(strFN) <> "" Then
        f_FileExist = True '有文件
    Else
        f_FileExist = False '没文件
    End If
End Function
Private Sub Command1_Click()
    Dim strFN As String
    strFN = App.Path & "\manongku.txt"
    MsgBox f_FileExist(strFN)
End Sub在当前目录放一个manongku.txt然后运行程序。