Obtém uma pasta e retorna um objeto Folder.
O FolderName pode ser um caminho absoluto e relativo.
Function GetFolder(ByVal FolderName)
On Error Resume Next
If Mid(FolderName, 2, 1) <> ":" Then
FolderName = Server.MapPath(FolderName)
End If
If Err Then Err.Clear
On Error GoTo 0
Dim FSO
Set FSO = Server.CreateObject("Scripting.FileSystemObject")
On Error Resume Next
Set GetFolder = FSO.GetFolder(FolderName)
If Err Then
Err.Clear
Set GetFolder = Nothing
End If
On Error GoTo 0
Set FSO = Nothing
End Function
Nenhum comentário:
Postar um comentário