| re: sleep methods in vb.net
In article <#rQ6CzhZFHA.2996@TK2MSFTNGP10.phx.gbl>, Jason wrote:[color=blue]
> In a vbscript making something sleep is as easy as this....
> Set WshShell = WScript.CreateObject("WScript.Shell")
> WScript.Sleep 5000
>
> In .net I've got the object created. I know it works because I use it else
> where.
> Set WshShell = CreateObject("WScript.Shell")
>
> How do I implement the sleep method?
>
> What I'm doing is using the WshShell to run/open the remote assistance help
> page, and then I use SendKeys to populate the pc name field, however I need
> a delay before the sendkeys call since depending on the pc, the remote
> assistacne page may take a sec or two to open. So if you sendkeys before
> the app is ready the key strokes wont get there.
>
> Thanks
>[/color]
You can as, the other posters indicated use
System.Threading.Thread.Sleep.
I'm wondering though, if it might not be possilbe to launch this using
the System.Diagnostics.Process class... If you could, then you would be
able to use the process instance method, WaitForInputIdle - which
basically, waits until the launched process is ready to begin accepting
input.
--
Tom Shelton [MVP] |