Can I use SelectFiles method to get directories only?

Apr 22, 2011 at 7:38 PM

I would like to use the FileSelector.SelectFiles method to get a string array back of just directories.  I tried to use the following as my select criteria, but that didn't return anyting.  "name=*.* and type=D and mtime < 2011-03-01".  Is it possible to get just the names of the folders that meet the criteria or will this only return files?

Dim objFileSelector as IonicFileSelector = New Ionic.FileSelector("name=*.* and type=D and mtime < 2011-03-01")

Dim strSelectedFiles() as String = objFileSelector.SelectFiles("C:\Test")

Coordinator
Apr 26, 2011 at 6:41 PM

Using the criteria "type = d and mtime > 2011-03-11" will work - it will retrieve only the names of directories.

You don't need the name=*.*, because that is implicit.

 

Apr 26, 2011 at 7:31 PM

I tried this and it didn't work.  I keep getting a strSelectedFiles with a count of zero.  I've got 3 subfolders under C:\Test.  I'm using 1.9.5.2 of the Ionic.Zip.dll.

Dim objFileSelector As Ionic.FileSelector = New Ionic.FileSelector("type = D and mtime > 2010-05-01")
Dim strSelectedFiles = objFileSelector.SelectFiles("C:\Test")