|
-
Jul 18th, 2007, 03:57 PM
#1
Thread Starter
Hyperactive Member
searching folders on mobile device
does anyone know how to search a mobile device for a particular file extention?
I would like to find a way to search all folders for .tsk files and have the results added to a combobox.
Microsoft Office Integration:Useful Database Links:
Connection Strings
Im a pogramar
Iam a programer
I’m a programor
I write code! 
-
Jul 19th, 2007, 02:09 AM
#2
Frenzied Member
Re: searching folders on mobile device
Hi,
try this, which returns everything sorted in an array - should be pretty easy to mod.
Pete
vb Code:
Public arrBases As ArrayList
...
arrFiles = New ArrayList
Search_For_Bases("\","*.txt")
Add_Files_From_Root(".txt")
arrFiles.Sort()
...
Public Sub Search_For_Files(ByVal sDir As String, ByVal sExt as string)
Dim d As String = ""
Dim f As String = ""
Try
For Each d In Directory.GetDirectories(sDir)
Search_For_Files(d)
For Each f In Directory.GetFiles(d, sExt)
Check_Files(f)
Next
Next
Catch excpt As System.Exception
....
End Try
End Sub
Public Sub Check_Files(ByVal fn As String)
arrFiles.Add(fn)
End Sub
Public Sub Add_Files_From_Root(ByVal sExt as string)
Dim FS As New DirectoryInfo("\")
Dim fileInfo As FileInfo
For Each fileInfo In FS.GetFiles()
If LCase(fileInfo.Extension) = sExt Then
Check_Files(fileInfo.FullName)
End If
Next
End Sub
-
Jul 19th, 2007, 03:27 AM
#3
Re: searching folders on mobile device
Note:
Search_For_Bases("\","*.txt") is mistakenly written, i think you wanted to write
Search_For_Files(("\","*.txt")
-
Jul 19th, 2007, 03:54 AM
#4
Frenzied Member
Re: searching folders on mobile device
Correct - you spotted the deliberate mistake
-
Jul 19th, 2007, 04:46 AM
#5
Re: searching folders on mobile device
Ok then
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|