Wait .5 seconds before continuing code VB.net

后端 未结 11 677
长发绾君心
长发绾君心 2021-02-05 04:25

I have a code and I want it to wait somewhere in the middle before going forward. After the WebBrowser1.Document.Window.DomWindow.execscript(\"checkPasswordConfirm();\",\"JavaSc

11条回答
  •  北荒
    北荒 (楼主)
    2021-02-05 05:04

    In web application a timer will be the best approach.

    Just fyi, in desktop application I use this instead, inside an async method.

    ... 
    Await Task.Run(Sub()
        System.Threading.Thread.Sleep(5000)
    End Sub)
    ...
    

    It work for me, importantly it doesn't freeze entire screen. But again this is on desktop, i try in web application it does freeze.

提交回复
热议问题