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

  • Home
  • SEARCH
  • 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 610181
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T17:38:50+00:00 2026-05-13T17:38:50+00:00

Here is my code, Dim allFiles As FileInfo() = tempDir.GetFiles(*.pdf, SearchOption.AllDirectories) I’ve googled and

  • 0

Here is my code,

Dim allFiles As FileInfo() = 
                        tempDir.GetFiles("*.pdf", SearchOption.AllDirectories)

I’ve googled and found that I need to change the permissions of my app from
Project properties > View UAC Settings > and change level to level="requireAdministrator"

But its also not working. I found something about FileIOPermission class, but dont know how to implement it.

==> Detailed code.

Dim tempDir As New DirectoryInfo(path)
        Dim FileDetails(4) As String
        Dim iTem As ListViewItem
        If (tempDir.Attributes <> FileAttributes.System) Then
            Dim allFiles As FileInfo() = tempDir.GetFiles("*.pdf", SearchOption.AllDirectories)
            Dim oneFIle As FileInfo
            For Each oneFIle In allFiles
                FileDetails(0) = oneFIle.Name()
                FileDetails(1) = oneFIle.FullName()
                FileDetails(2) = oneFIle.Length() / (1024 * 1024)
                FileDetails(2) = FileDetails(2).Remove(5)
                iTem = New ListViewItem(FileDetails)
                ListView1.Items.Add(iTem)
            Next
        End If

Path is a string that contains the path required, in this case G:\

  • 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-05-13T17:38:50+00:00Added an answer on May 13, 2026 at 5:38 pm

    Ok, I think I solved the case, I just iterated each folder, checked their attributes and then added to the list.. I think it’s working.. Plz check it a bit..

    Dim tempDir As New DirectoryInfo(path)
        Dim FileDetails(4) As String
        Dim iTem As ListViewItem
        Try
            Dim allFiles As FileInfo() = Nothing 
            For Each Directory In tempDir.GetDirectories()
                Try
                    If (Directory.Attributes <> FileAttributes.System) Then
                        allFiles = Directory.GetFiles("*.pdf", SearchOption.AllDirectories)
                    End If
                    Dim oneFIle As FileInfo
    
                    For Each oneFIle In allFiles
                        FileDetails(0) = oneFIle.Name()
                        FileDetails(1) = oneFIle.FullName()
                        FileDetails(2) = oneFIle.Length() / (1024 * 1024)
                        FileDetails(2) = FileDetails(2).Remove(5)
                        iTem = New ListViewItem(FileDetails)
                        ListView1.Items.Add(iTem)                        
                    Next
                Catch ex As Exception
    
                End Try
            Next
        Catch ex As UnauthorizedAccessException
    
        End Try
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is my Code: Dim CompanyName, _ CompanyDomain, _ CompanyEmail, _ CompanySupportPhone Call GetEmailList
Not sure how to do this, here is my code Dim oWeb As New
Here my code, I need to insert into mysql database I have mysql,php,android 1)
Here is my code Dim dt As DataTable = New DataTable(Intervenant) For Each column
Here is my code: Dim TestHeader As String = Referer: http://www.testrefferer.com If chkRefferer.Checked =
Here is my code: Dim connectionString As String =Provider=Microsoft.Jet.OLEDB.4.0;Data Source=F:\ACCESS DATABASE\search.mdb Dim selectCommand As
What is wrong here in the code Dim sReaderList As String sReaderList = New
I'm doing SOME VB6 - MS WORD application.., here's my code dim WordObj As
That's my code: Dim num as integer = 0 For Each s As String
I have this code here: Dim MasterIndex As String()() Private Function Lookup(ByVal Search_path As

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.