S
Saga
Hi all. Now I am processing data in folders. I get a listing of folder
contents and have to test to determine whether item is folder or
file. I have this routine:
strPath is previously set with valid data, strType is previously defined.
Dim objDI As New System.IO.DirectoryInfo(strPath)
For Each objFSI As System.IO.FileSystemInfo In
objDI.GetFileSystemInfos()
If objFSI.Attributes() And IO.FileAttributes.Directory Then
strType = "Folder"
Else
strType = "File"
End If
Next
My question is whether this is the best way to do this. I "explored" a bit
and
did not find any other obvious way. Any feedback is welcomed! Thanks, Saga
contents and have to test to determine whether item is folder or
file. I have this routine:
strPath is previously set with valid data, strType is previously defined.
Dim objDI As New System.IO.DirectoryInfo(strPath)
For Each objFSI As System.IO.FileSystemInfo In
objDI.GetFileSystemInfos()
If objFSI.Attributes() And IO.FileAttributes.Directory Then
strType = "Folder"
Else
strType = "File"
End If
Next
My question is whether this is the best way to do this. I "explored" a bit
and
did not find any other obvious way. Any feedback is welcomed! Thanks, Saga