Home > front end >  Repeat Same Action In VB Console every second
Repeat Same Action In VB Console every second

Time:10-29

I want to execute this code, unfortunately it executes only once and then stops. how do execute this code to display every second? and after doing this 100 times, to stop, that is, after a fixed 100 seconds.

Do

    Dim index As Integer = 0

    index  = 1

    Console.WriteLine(RandomString(102, 102))

    Console.ReadLine()
    Do
        Threading.Thread.Sleep(1000)
    Loop Until index = 100

Loop

CodePudding user response:

Try this:

Dim index As Integer = 0
Do Until index = 100
       index  = 1

       Console.WriteLine(RandomString(102, 102))
       Threading.Thread.Sleep(1000)
Loop
Console.ReadLine()
  • Related