954,514 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Read File Names from Directory

Hello DaniWeb, it has been a while since I have asked a question here so I thought now would be a great time to do so. I am creating an application that loops through the file names of a specific directory, in this case, the System32 folder. I want the program to compile a list of the file names and then I want the file names to be displayed on a Timer_Tick event so the name will change on every tick. If anyone could provide a snippet of code to achieve this that would be great. I have been researching and debugging all night with no luck. Thanks and have a great day!

-Chris

NetJunkie
Junior Poster
158 posts since Aug 2011
Reputation Points: 41
Solved Threads: 28
 

You can get the list of files with

Dim filelist() As String = System.IO.Directory.GetFiles("c:\windows\system32")

Use a class variable to keep track of which file name to display next. The timer tick handler can advance the index (and wrap to zero if you want to repeat).

Reverend Jim
Posting Shark
Moderator
1,167 posts since Aug 2010
Reputation Points: 253
Solved Threads: 159
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: