Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7741241
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T08:58:32+00:00 2026-06-01T08:58:32+00:00

Visual Studio 2008 (vb.net) I made simple anivirus but when I make Full scan

  • 0

Visual Studio 2008 (vb.net)
I made simple anivirus but when I make Full scan by this code:

FolderBrowserDialog1.SelectedPath = ("C:\")
    'first scan:************************************
    Try

        For Each strDir As String In
        System.IO.Directory.GetDirectories(FolderBrowserDialog1.SelectedPath)

            For Each strFile As String In System.IO.Directory.GetFiles(strDir)

                ListBox1.Items.Add(strFile)

            Next
        Next

        'Start the timer:

    Catch ex As Exception
    End Try

    Timer1.Start()`

Just scan the first 6 files …
I think the problem from Windows Folder permissions (Windows – Program Files …etc)
So how to fix it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T08:58:33+00:00Added an answer on June 1, 2026 at 8:58 am

    You could try the following:

    For Each strFile As String In System.IO.Directory.GetFiles(strDir, "*", IO.SearchOption.AllDirectories)
    

    Edit:

    You could try the last solution found in this thread:
    http://www.vbforums.com/showthread.php?t=624969

    I tried this myself and it was super slow, but worked fine.

    Public Class Form1
    
        Private Sub foo(ByVal aDir As String)
            Try
    
                Dim di As New IO.DirectoryInfo(aDir)
                Dim aryFiles() As IO.FileInfo = di.GetFiles("*.*")
                Dim aryDirs() As IO.DirectoryInfo = di.GetDirectories()
    
                For Each fi As IO.FileInfo In aryFiles
                    rslts.Add(fi.FullName)
                Next
    
                For Each d As IO.DirectoryInfo In aryDirs
                    foo(d.FullName)
                Next
    
            Catch ex As Exception
                'Stop 'the catch should be more specific
            End Try
    
        End Sub
    
        Dim rslts As List(Of String)
    
        Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
            rslts = New List(Of String)
            foo("C:\")
            ListBox1.Items.Clear()
            ListBox1.Items.AddRange(rslts.ToArray)
         End Sub
    End Class
    

    It looks like your solution essentially loops through the first folder it can find and stops there. This solution is a bit different as it will recursively go through all the files and folders based on the start location.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does Visual Studio .NET 2008 come with UISpy? I ask this for for the
I have .net 3.5 project containing some rdlc reports made in Visual Studio 2008.
I am a newb to vb.net(visual studio 2008).i am trying to make an app
So this is a Visual Studio 2008, .NET, WPF, XBAP, Windows 7 question, regarding
I have an asp.net web application that I made in Visual Studio 2008. Everything
I have a very simple ASP.NET web application created under Visual Studio 2008 (SP1),
In Visual Studio 2008 ASP.NET in C#, what are the pros and cons of
I have used Visual Studio 2008 ASP.NET AccessDataSource Wizard to generate the update command.
I have a Visual Studio 2008 C# .NET 3.5 project that I am implementing
We have an ASP.Net MVC 1.0 solution developed using Visual Studio 2008 and .net

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.