RE: [C#] Creating a Pastebin bot 09-13-2015, 08:23 PM
#18
(09-13-2015, 07:28 PM)XFL Wrote: You provide good points. I do not ppan to make the bot based off of the webbrowser componet, ill be using htmlagilitypack along side with the webbrowser so a user could see the progress. That componet can also be disabled and visble set to false to improve speed and performance.
Remember, visibility will allow you to avoid all of the drawing methods to draw the control to a form, but it won't change the way the control works in the background. The default webbrowser control has an event that fires when the page is fully loaded for example. That's still a bit slower than sending direct HTTP requests because that page loading before you can click a button for instance is like a time delay to the actual action that works with probably a POST request in the background. With an HTTP POST request you can avoid that delay because you aren't waiting for a page to load before you send the POST request to simulate that button click.
Also, you have much more control over the way that POST request is sent, but it's much easier to multi-thread that action so that you can do other things in the meantime, than it is with a webbrowser control because the webbrowser control itself probably exists on the UI thread itself. You can delegate work to other threads, but you still have to join threads to update the UI if there is one.
![[+]](https://sinister.ly/images/modern/collapse_collapsed.png)