Results 1 to 5 of 5

Thread: searching folders on mobile device

  1. #1

    Thread Starter
    Hyperactive Member kxcntry99's Avatar
    Join Date
    Jun 2006
    Location
    Pennsylvania
    Posts
    342

    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!

  2. #2
    Frenzied Member
    Join Date
    Oct 2005
    Posts
    1,286

    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:
    1. Public arrBases As ArrayList
    2. ...
    3.  
    4.     arrFiles = New ArrayList
    5.         Search_For_Bases("\","*.txt")
    6.         Add_Files_From_Root(".txt")
    7.         arrFiles.Sort()
    8. ...
    9.  
    10.  
    11.  Public Sub Search_For_Files(ByVal sDir As String, ByVal sExt as string)
    12.        
    13.         Dim d As String = ""
    14.         Dim f As String = ""
    15.         Try
    16.             For Each d In Directory.GetDirectories(sDir)
    17.                     Search_For_Files(d)
    18.                     For Each f In Directory.GetFiles(d, sExt)
    19.                         Check_Files(f)
    20.                     Next
    21.             Next
    22.         Catch excpt As System.Exception
    23.             ....
    24.         End Try
    25.  
    26.  
    27.  
    28.     End Sub
    29.     Public Sub Check_Files(ByVal fn As String)
    30.         arrFiles.Add(fn)
    31.     End Sub
    32.     Public Sub Add_Files_From_Root(ByVal sExt as string)
    33.         Dim FS As New DirectoryInfo("\")
    34.         Dim fileInfo As FileInfo
    35.  
    36.         For Each fileInfo In FS.GetFiles()
    37.             If LCase(fileInfo.Extension) = sExt Then
    38.                 Check_Files(fileInfo.FullName)
    39.             End If
    40.         Next
    41.  
    42.     End Sub
    Pete Vickers
    MVP - Device Application Development
    http://www.gui-innovations.com http://mobileworld.appamundi.com/blogs/

  3. #3
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,763

    Re: searching folders on mobile device

    Note:
    Search_For_Bases("\","*.txt") is mistakenly written, i think you wanted to write
    Search_For_Files(("\","*.txt")

  4. #4
    Frenzied Member
    Join Date
    Oct 2005
    Posts
    1,286

    Re: searching folders on mobile device

    Correct - you spotted the deliberate mistake
    Pete Vickers
    MVP - Device Application Development
    http://www.gui-innovations.com http://mobileworld.appamundi.com/blogs/

  5. #5
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,763

    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
  •  



Click Here to Expand Forum to Full Width