quinta-feira, 22 de novembro de 2007

FolderExists()

Checa se uma pasta existe.
O DirName pode ser um caminho absoluto ou relativo.

Function FolderExists(ByVal DirName)

On Error Resume Next
If Mid(DirName, 2, 1) <> ":" Then
DirName = Server.MapPath(DirName)
End If
On Error GoTo 0

Dim fso
Set fso = Server.CreateObject("Scripting.FileSystemObject")
FolderExists = fso.FolderExists(DirName)
Set fso = Nothing

End Function

Nenhum comentário: