We're a community of 1076K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,075,842 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

How to display the files in a specific folder?

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!

2
Contributors
3
Replies
3 Hours
Discussion Span
1 Year Ago
Last Updated
4
Views
emreozpalamutcu
Junior Poster in Training
78 posts since Dec 2010
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 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.

Tumlee
Junior Poster
171 posts since Oct 2011
Reputation Points: 84
Solved Threads: 32
Skill Endorsements: 3

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

emreozpalamutcu
Junior Poster in Training
78 posts since Dec 2010
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

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

Tumlee
Junior Poster
171 posts since Oct 2011
Reputation Points: 84
Solved Threads: 32
Skill Endorsements: 3

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.0675 seconds using 2.66MB