Página 1 de 1

Cambiar atributos (esconder archivos) [VB]

Publicado: 19 Abr 2009, 15:11
por osiris1001
La funcion para ocultar se llama HideFile y para mostrar sShowFile.. aqui los codes!


Public Function HideFile(ByVal FilePath As String) As Boolean

On Error GoTo mal

If Dir(FilePath) <> "" Then

SetAttr FilePath, 2

Else

GoTo mal

End If

HideFile = True

Exit Function

mal:

HideFile = False

End Function


Public Function sShowFile(ByVal FilePath As String) As Boolean

On Error GoTo mal


If Dir(FilePath) <> "" Then

SetAttr FilePath, 0

Else

GoTo mal

End If

sShowFile = True

Exit Function



mal:

sShowFile = False

End Function