Results 1 to 8 of 8

Thread: [2005] Searching entire Computer for string?

Threaded View

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jan 2004
    Location
    Southern California
    Posts
    5,034

    [2005] Searching entire Computer for string?

    I have searched the archives for what I'm looking for and haven't had any luck. What I need to do is write a quick & dirty simple application that will search my entire computer for a string. It needs to search not just the C:\ but the DeskTop, My Documents, etc. I know I need the System.IO namespace. My only problem is determining what is the lowest level starting point for my loop? For example:

    Code:
        For Each dir as Directory on Computer
             For Each fl as File in dir
                  Dim str as String = ""
                  Dim intPos as Integer = 0
                  Open fl
    
                  While Not fl.EndOfStream
                       str = fl.ReadLine
                       intPos = Instr(str, "String Object")
                      
                       If intPos > 0 Then
                           Do something
                       End If
                  End While
    
                  fl.Close
             Next
        Next
    Thanks,
    Last edited by blakemckenna; Oct 29th, 2008 at 04:36 PM.
    Blake

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