Results 1 to 8 of 8

Thread: Searching All Files (Access Denied)

Threaded View

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2008
    Posts
    1,754

    Searching All Files (Access Denied)

    Hello here is my code:

    vb.net Code:
    1. Module FileCheck
    2.     Public BW_AntiCorrupt As New Threading.Thread(AddressOf AntiCorrupt)
    3.     Dim THardDrive As String = Environment.GetFolderPath(Environment.SpecialFolder.Desktop)
    4.     Dim HardDrive As String = THardDrive.Substring(0, THardDrive.IndexOf("\") + 1) 'C:\
    5.     Public ContinueSearch As Boolean = True
    6.     Public Results As New List(Of String)
    7.     Public DoneGather As Boolean = False
    8.     Public DiagnosticReport As String
    9.  
    10.     Public Sub AntiCorrupt()
    11.         Dim DirInfo As New IO.DirectoryInfo(HardDrive)
    12.         DoneGather = False
    13.         Results.AddRange(IO.Directory.GetFiles(HardDrive, "*.*", IO.SearchOption.AllDirectories))
    14.         DoneGather = True
    15.         For Each file As String In Results
    16.             If ContinueSearch = True Then
    17.                 CheckFile(file)
    18.             End If
    19.         Next
    20.     End Sub
    21.     Private Sub CheckFile(ByVal file As String)
    22.         Dim finfo As New IO.FileInfo(file)
    23.  
    24.     End Sub
    25. End Module

    This code is being called wit this code:
    vb.net Code:
    1. BW_AntiCorrupt.IsBackground = True
    2.                 BW_AntiCorrupt.Start()
    3.                 frmFileCheckResults.Show()

    I am having a problem. The IO.Directory.GetFiles code is resulting in error do to the fact that it is trying to access the Temp folder in the Windows folder on drive C:\. Apparently that folder is restricted... When the code encounters that folder the code stops retrieving files.

    Is there a way around this? Is there somewhere i can give my program administrator access? If not then am i able to skip the files in that location?
    Last edited by noahssite; Jun 6th, 2009 at 10:43 AM.

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