Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Scanning all files in a computer

Scanning all files in a computer

Scheduled Pinned Locked Moved C#
question
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sharpiesharpie
    wrote on last edited by
    #1

    I'm looking for the best way to scan (go through) all the files on the computer (for search purposes etc.). i tried some ways but there's certain problems i couldn't find a solution to, such as a "no access" exception when it gets to the "system volume information" dir. so...what's the best way to do it?

    D 1 Reply Last reply
    0
    • S sharpiesharpie

      I'm looking for the best way to scan (go through) all the files on the computer (for search purposes etc.). i tried some ways but there's certain problems i couldn't find a solution to, such as a "no access" exception when it gets to the "system volume information" dir. so...what's the best way to do it?

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      You can't get access to the System Volumn Information folder anyway. It belongs to the system and only the SYSTEM has any rights to what's in there. Strangely enough, you're saying that you can't get into this folder when you try to build an index of all the data and files on the drive, but yet, that's exactly what's in that folder. The Indexing Service already does this for you and stores it's index information in that folder. You might want to get a little primer by reading Heath Stewerts article on it here[^]. There's a link in the article to the documentation on MSDN. I highly suggest following it.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007

      S 1 Reply Last reply
      0
      • D Dave Kreskowiak

        You can't get access to the System Volumn Information folder anyway. It belongs to the system and only the SYSTEM has any rights to what's in there. Strangely enough, you're saying that you can't get into this folder when you try to build an index of all the data and files on the drive, but yet, that's exactly what's in that folder. The Indexing Service already does this for you and stores it's index information in that folder. You might want to get a little primer by reading Heath Stewerts article on it here[^]. There's a link in the article to the documentation on MSDN. I highly suggest following it.

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007

        S Offline
        S Offline
        sharpiesharpie
        wrote on last edited by
        #3

        uhh..that's ASP.NET and i didn't say i WANTED access to System volume information...it just lists that directory along with all the others and when it tries to access it, it raises an exception and terminates the whole operation =\

        L D 2 Replies Last reply
        0
        • S sharpiesharpie

          uhh..that's ASP.NET and i didn't say i WANTED access to System volume information...it just lists that directory along with all the others and when it tries to access it, it raises an exception and terminates the whole operation =\

          L Offline
          L Offline
          Luc Pattyn
          wrote on last edited by
          #4

          So catch the exception and skip that directory !

          Luc Pattyn [My Articles]

          1 Reply Last reply
          0
          • S sharpiesharpie

            uhh..that's ASP.NET and i didn't say i WANTED access to System volume information...it just lists that directory along with all the others and when it tries to access it, it raises an exception and terminates the whole operation =\

            D Offline
            D Offline
            Dave Kreskowiak
            wrote on last edited by
            #5

            sharpiesharpie wrote:

            uhh..that's ASP.NET

            uhh... the EXACT same techniques are used for every other file on the system, not just ASP.NET files. Next time, try reading the ENTIRE article and following the links in it.

            sharpiesharpie wrote:

            and i didn't say i WANTED access to System volume information

            I didn't say you did either.

            sharpiesharpie wrote:

            it just lists that directory along with all the others and when it tries to access it, it raises an exception and terminates the whole operation =\

            It terminates because your code isn't written properly to handle errors where your code can't go. I told you, the Indexing Service already does this. All you have to do is apply the techniques found in that article and the MSDN documentation and you have a solution that's alomst pre-written.

            A guide to posting questions on CodeProject[^]
            Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                 2006, 2007

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups