Jump to content
UBot Underground

Anything Similar To Wait In C#


Recommended Posts

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

Link to post
Share on other sites

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

Link to post
Share on other sites

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.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...