Thursday, 21 February 2013

In VB6 File exists or Not

    Private Sub Command1_Click()
    '============================
    Dim fso As FileSystemObject
    Dim sFilePath As String
    
        Set fso = New FileSystemObject
      
        sFilePath = "c:\test.txt"
        If fso.FileExists(sFilePath) Then
            MsgBox "File Exist."
        Else
            MsgBox "File Doesn't Exist."
        End If
    
    End Sub

No comments:

Post a Comment