How to make the system sleep for a while.
-
How can I make the system sleep for a while so that in the meanwhile my files get populated with some data and after that I can access the file for processing. Is there any way in vb.net or I have to call some API functions ? Thanks in Advance.
Sekhar :)
-
How can I make the system sleep for a while so that in the meanwhile my files get populated with some data and after that I can access the file for processing. Is there any way in vb.net or I have to call some API functions ? Thanks in Advance.
Sekhar :)
System.Threading.Thread.Sleep(1000) '1000 Milli Second delay Or you can use a different thread to do the population of the files.
Private Sub PopulateFiles ..... End Sub
Use the lines below in one of your Procedures, which then calls the PopulateFiles procedure on a new thread.Dim thPopulateFiles As New System.Threading.Thread(AddressOf PopulateFiles) thPopulateFiles.Start()
It can be tricky if you access the file before the new thread has finished executing - maybe look at Thread.Join as well.