Similar code for timer needed

  • Thread starter Thread starter Derek Hart
  • Start date Start date
D

Derek Hart

I have the following code in Access. I use it to delete some files, but I
need the timer because the system may still have a hold on the files. This
works nicely to clean up a directory. What is similar code for VB.Net?

PauseTime = 5
start = Timer
Do While Timer < start + PauseTime
On Error Resume Next
RmDir MergeFolder
If Dir(MergeFolder, vbDirectory) = "" Then Exit Do
Loop


Derek
 
Hello Derek,

The System.Threading.Thread.Sleep method will be helpful to you. It blocks
the current thread for the specified number of milliseconds. You may get
more detailed info about it from the link below

http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemThreadingThrea
dClassSleepTopic.asp

I hope this helps you.

Best regards,

Lion Shi [MSFT]
MCSE, MCSD
Microsoft Support Engineer

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. 2003 Microsoft Corporation. All rights
reserved.
--------------------
 
Back
Top