Visual Basic - SABER SI UN ARCHIVO EXISTE

Life is soft - evento anual de software empresarial
 
Vista:

SABER SI UN ARCHIVO EXISTE

Publicado por Check (1 intervención) el 03/03/2005 19:43:04
Hola, quisiera saber si alguin puede decirme como hacer para saber si un archivo existe o no, no creo que sea muy dificil.

Cualquier ayuda es de mucha utilidad

Gracias
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:SABER SI UN ARCHIVO EXISTE

Publicado por Juan Antonio Lozano Legaria (39 intervenciones) el 03/03/2005 20:12:02
\'Comprobación De Si Existe Un Directorio Determinado

Public Function DirExists(ByVal sDirName As String) As Boolean
Dim sDir As String
On Error Resume Next
DirExists = False
sDir = Dir$(sDirName, vbDirectory)
If (Len(sDir) > 0) And (Err = 0) Then
DirExists = True
End If
End Function

\'Comprueba si Existe un Fichero
\'
Public Function FileExists(sFile as string) as Boolean
On Error GoTo Trapit
x = GetAttr(filename)
Trapit:
If Err = 0 Then
FileExists = True
Else
FileExists = False
Exit Function
End If
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar