borderAndreaVB free resources for Visual Basic developersborder

AndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2008 Andrea Tincani
:: Function to find if file exists

Author  

David Costelloe

Language  

VB5, VB6

Operating Systems  

Windows 95, 98 and NT
Module

Public Function FileExists(filename As String) As Boolean
    FileExists = (Dir(filename, vbNormal Or vbReadOnly Or vbHidden Or vbSystem Or vbArchive) <> "")
End Function

Usage

'Usage:
Private Sub Command1_Click()
    If FileExists("C:\Config.sys") Then
        MsgBox "Config.sys is available"
    Else
        MsgBox "Sorry Can't find Config.sys"
    End If
End Sub

:: Navigation

Home

Files and Disks Tips

Previous Tip

Next Tip

:: Search this site
Google
:: Related Topics
icon 11-05-2008 Re: Calling ini file (problem with code) by Keithuk
icon 16-01-2008 Re: Find record, multiple result by yronium
icon 07-04-2007 Re: BACK UP AND RESTORE DATABASE by yronium
icon 08-03-2007 Sound Frequency Generation? HOW? by astro_girl_690
icon 28-12-2006 Re: Calling ini file (problem with code) by yronium
Partners: Il portale per lui e lei | Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2008 Andrea Tincaniborder