ds062692 19 Posted July 24, 2015 Report Share Posted July 24, 2015 I am trying to recreate a bot of mine in c# using the standard web browser and was wondering if there is anything similar to Wait in c#. I know there is a Thread.Sleep but that freezes the browser. Thanks Quote Link to post Share on other sites
pash 504 Posted July 24, 2015 Report Share Posted July 24, 2015 Try.Application.DoEvents Quote Link to post Share on other sites
kev123 132 Posted July 24, 2015 Report Share Posted July 24, 2015 There's several things you could do it as pash said, or you could also split the browser control into a background thread and invoke/begininvoke the browser with commands. This also means if you have any other long running operations the browser/application will always be responsive and you can code the browser application similar to how you would with ubot. By that I mean not worrying about blocking UI. or use await and async keywords with task.delay if your using .net 4.5 Quote Link to post Share on other sites
the_way 52 Posted July 24, 2015 Report Share Posted July 24, 2015 How do you dudes figure out all the equivalent ubot commands, they always seem to be such strange named compared to the intuitive naming of ubot Quote Link to post Share on other sites
juicehunter 30 Posted July 25, 2015 Report Share Posted July 25, 2015 Thats because your calling Thread.Sleep on the foreground thread. I can already tell you that you are programming in a wrong way in c#. You need to let the work be executed in the background thread or by using Async. Quote Link to post Share on other sites
Aymen 385 Posted July 25, 2015 Report Share Posted July 25, 2015 Try Thread.Sleep(1000); //use this to wait one sec , the value between the parentheses is in milliseconds Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.