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!


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).

commented: Thanks! +5
Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.