Drilling down through directories

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jack Russell

    #1

    Drilling down through directories

    I need to drill down from a directory through all the sub directories
    and build up a list of files. I have VB6 code to do this but it uses
    APIs etc and am hoping that there is a better way of doing in .net 2003

    I would appreciate any help or examples that anyone can give me

    Thanks

    Jack Russell
  • Jack Russell

    #2
    Re: Drilling down through directories

    Jack Russell wrote:
    I need to drill down from a directory through all the sub directories
    and build up a list of files. I have VB6 code to do this but it uses
    APIs etc and am hoping that there is a better way of doing in .net 2003
    >
    I would appreciate any help or examples that anyone can give me
    >
    Thanks
    >
    Jack Russell
    Its ok I found getdirectories!

    Comment

    • Michael C

      #3
      Re: Drilling down through directories

      "Jack Russell" <jackr@norubbis h.tpg.com.auwro te in message
      news:ecjxzSBcHH A.264@TK2MSFTNG P05.phx.gbl...
      Jack Russell wrote:
      >I need to drill down from a directory through all the sub directories and
      >build up a list of files. I have VB6 code to do this but it uses APIs etc
      >and am hoping that there is a better way of doing in .net 2003
      >>
      >I would appreciate any help or examples that anyone can give me
      >>
      >Thanks
      >>
      >Jack Russell
      Its ok I found getdirectories!
      I did this as an enumerator, so I could just do:

      for each file in new DirEnumerator(" C:\")

      I can't remember the exact details but I could dig it up if you are
      interested.

      Michael


      Comment

      • Jack Russell

        #4
        Re: Drilling down through directories

        Michael C wrote:
        "Jack Russell" <jackr@norubbis h.tpg.com.auwro te in message
        news:ecjxzSBcHH A.264@TK2MSFTNG P05.phx.gbl...
        >
        >>Jack Russell wrote:
        >>
        >>>I need to drill down from a directory through all the sub directories and
        >>>build up a list of files. I have VB6 code to do this but it uses APIs etc
        >>>and am hoping that there is a better way of doing in .net 2003
        >>>
        >>>I would appreciate any help or examples that anyone can give me
        >>>
        >>>Thanks
        >>>
        >>>Jack Russell
        >>
        >>Its ok I found getdirectories!
        >
        >
        I did this as an enumerator, so I could just do:
        >
        for each file in new DirEnumerator(" C:\")
        >
        I can't remember the exact details but I could dig it up if you are
        interested.
        >
        Michael
        >
        >
        Thanks but I have nearly finished

        Jack

        Comment

        • =?Utf-8?B?S2VycnkgTW9vcm1hbg==?=

          #5
          RE: Drilling down through directories

          Jack,

          Here is some code that you might be able to modify for your needs:

          'Be sure to have an Imports System.IO statement in the class that contains
          this code

          Private Sub DisplayFolderIn fo(ByVal folder As String)

          Dim di As New DirectoryInfo(f older)
          Dim fi As FileInfo

          MsgBox("Folder: " & folder)

          For Each fi In di.GetFiles
          MsgBox("File: " & fi.FullName)
          Next

          Dim subDI As DirectoryInfo
          For Each subDI In di.GetDirectori es
          DisplayFolderIn fo(di.FullName & "\" & subDI.Name)
          Next

          End Sub

          To get the process started:

          DisplayFolderIn fo("c:\Test")

          Kerry Moorman


          "Jack Russell" wrote:
          I need to drill down from a directory through all the sub directories
          and build up a list of files. I have VB6 code to do this but it uses
          APIs etc and am hoping that there is a better way of doing in .net 2003
          >
          I would appreciate any help or examples that anyone can give me
          >
          Thanks
          >
          Jack Russell
          >

          Comment

          Working...