Similar code for timer needed

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
 
L

Lion Shi

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top