Advertisement

10.27.2005 at 06:57PM PDT, ID: 21611070
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.0

Get all files in a Directory including subfolders is to slow.

Asked by Fuzzy024 in Microsoft Visual Basic.Net, Server Side Includes (SSI)

Tags: , ,

Hey everyone ~

      I have an issue that is just a driving me nuts.  I know how to get all files in a folder including everything in all subfolders, but after it gets to about 5000 files or so it begins to slow down.  Which is a problem when you are trying to get everything in "Program Files" or "Windows."  Below is the code i use to get all the files.

Public Function FindFilePaths(ByVal strpath As String)

            Dim strDir() As String
            Dim filesize As String
            Dim lngBytes As Long

            strDir = System.IO.Directory.GetDirectories(strpath)

            Dim enDir As System.Collections.IEnumerator

            enDir = strDir.GetEnumerator

            While enDir.MoveNext

                Try
                    Dim strFiles() As String

                    strFiles = System.IO.Directory.GetFiles(CStr(enDir.Current))

                    Dim enFiles As System.Collections.IEnumerator

                    enFiles = strFiles.GetEnumerator

                    While enFiles.MoveNext

                        System.Windows.Forms.Application.DoEvents()
                        'Console.WriteLine(CStr(enFiles.Current))
                        intFileCount += 1

                        lngBytes = FileLen(CStr(enFiles.Current))
                        ArrLstCopyQBytes.Add(lngBytes)
                        filesize = convertSize(lngBytes)

                        lngTOTBytes += lngBytes

                        'CONVERTSIZE turns the number of bytes into the appropriate converstion (KB,MB,GB)
                        lblTotSIZE.Text = convertSize(lngTOTBytes).ToString

                        'FILLQUEUE FILLS AN ARRAYLIST OR A LISTVIEW CONTROL WITH THE SOURCE, DESTINATION, AND FILESIZE.
                        fillQueue(CStr(enFiles.Current), strDESTINATION, filesize)

                        filesize = ""

                        GC.Collect()

                    End While

                Catch ex As Exception
                    lstStatus.Items.Add("Could not read files in " & strpath)
                Finally
                    GC.Collect()
                End Try

                Me.Update()
                Call FindFilePaths(CStr(enDir.Current))

            End While

            GC.Collect()

        End Function

   This works extremely well when there is a small list of files (fewer than 5000).  But once it starts getting about 10000 or even 40000 (Which "Program Files" easily gets that high) it becomes way to slow.  This is VB.NET 2003.  Anyone have any ideas on how to speed this up, its really nerve racking how slow it becomes?

Fuzzy024~Start Free Trial
[+][-]10.27.2005 at 07:32PM PDT, ID: 15176270

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.27.2005 at 07:55PM PDT, ID: 15176348

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.27.2005 at 08:23PM PDT, ID: 15176420

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.27.2005 at 08:39PM PDT, ID: 15176460

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.27.2005 at 09:59PM PDT, ID: 15176646

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.28.2005 at 05:37AM PDT, ID: 15178290

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.28.2005 at 06:17AM PDT, ID: 15178590

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.28.2005 at 08:20AM PDT, ID: 15179733

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.28.2005 at 08:53AM PDT, ID: 15180069

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Microsoft Visual Basic.Net, Server Side Includes (SSI)
Tags: files, get, directory
Sign Up Now!
Solution Provided By: TheLearnedOne
Participating Experts: 4
Solution Grade: A
 
 
[+][-]10.28.2005 at 10:00AM PDT, ID: 15180770

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.29.2005 at 11:01AM PDT, ID: 15185755

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.31.2005 at 07:33AM PST, ID: 15193354

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32