Wait .5 seconds before continuing code VB.net

后端 未结 11 710
长发绾君心
长发绾君心 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:06

    Make a timer, that activates whatever code you want to when it ticks. Make sure the first line in the timer's code is:

    timer.enabled = false
    

    Replace timer with whatever you named your timer.

    Then use this in your code:

       WebBrowser1.Document.Window.DomWindow.execscript("checkPasswordConfirm();","JavaScript")
    timer.enabled = true
    Dim allelements As HtmlElementCollection = WebBrowser1.Document.All
    For Each webpageelement As HtmlElement In allelements
        If webpageelement.InnerText = "Sign Up" Then
            webpageelement.InvokeMember("click")
        End If
    Next
    

提交回复
热议问题