1,105,384 Community Members

How to display the files in a specific folder?

Member Avatar
emreozpalamutcu
Junior Poster in Training
78 posts since Dec 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

I'm trying to make a little disk cleaner program and I couldn't figure out how to display the results of scanned directory on list view tool on windows form application. I have a 3 columns and these are File Name, Folder Path and File Size. I want the program to scan for example this location: C:\Users\Emre\AppData\Local\CrashDumps and display all of the files in that location on the list view tool. How could i do this? And how do display the file size and file location on the next 2 colomns and these other two colomns are sub items.

Thank you!

Member Avatar
Tumlee
Posting Whiz in Training
203 posts since Oct 2011
Reputation Points: 42 [?]
Q&As Helped to Solve: 41 [?]
Skill Endorsements: 4 [?]
 
0
 

The header you're looking for is <dirent.h> , which allows you to use the opendir() function. That function opens a specific folder and allows you to iterate through all the files in that folder and view their names and sizes. If you look up tutorials on using that library, you'll find what you need.

Member Avatar
emreozpalamutcu
Junior Poster in Training
78 posts since Dec 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

That is for .net right? I'm using windows form applications and I need to display these files on a list view tool

Member Avatar
Tumlee
Posting Whiz in Training
203 posts since Oct 2011
Reputation Points: 42 [?]
Q&As Helped to Solve: 41 [?]
Skill Endorsements: 4 [?]
 
0
 

You don't need .NET to use <dirent.h> . It's part of the standard C library.

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: