Register and join over 40,000 other developers!
Recent Topics
-
The Game You Are Waiting For?
WendellHarper - Dec 06 2020 01:21 PM
-
Quora and Reddit Backlinks
WendellHarper - Dec 06 2020 01:14 PM
-
Delete account
pindo - Jul 23 2020 01:33 AM
-
Print specific values from dictionary with a specific key name
Siten0308 - Jun 20 2019 01:43 PM
-
Learn algorithms and programming concepts
johnnylo - Apr 23 2019 07:49 AM
Recent Blog Entries
Recent Status Updates
Popular Tags
- networking
- Managed C++
- stream
- console
- database
- authentication
- Visual Basic 4 / 5 / 6
- session
- Connection
- asp.net
- import
- syntax
- hardware
- html5
- array
- mysql
- java
- php
- c++
- string
- C#
- html
- loop
- timer
- jquery
- ajax
- javascript
- programming
- android
- css
- assembly
- c
- form
- vb.net
- xml
- linked list
- login
- encryption
- pseudocode
- calculator
- sql
- python
- setup
- help
- game
- combobox
- binary
- hello world
- grid
- innerHTML

How do I make my bot to work with multithreading?
Started by codegirl, Sep 04 2012 01:55 AM
5 replies to this topic
#1
Posted 04 September 2012 - 01:55 AM
Hello
I had just finish a test bot that would login into my yahoo mail and then log out just to see if it work. Yes it work when using a webbrowser but could someone provide me with sample codes that I could use if I were to put this as multithreading using 5 of my yahoo email accounts? Do I need to create five webbrowsers for this?
I had just finish a test bot that would login into my yahoo mail and then log out just to see if it work. Yes it work when using a webbrowser but could someone provide me with sample codes that I could use if I were to put this as multithreading using 5 of my yahoo email accounts? Do I need to create five webbrowsers for this?
#2
Posted 04 September 2012 - 02:34 AM
Yes, you have to create 5 WebBrowser or (5 tab of WebBrowser?). But you can't access (update) WebBrowser from thread.
Another way is to use WebClient class. You can use it in threads. You can use 3'rd party libraries (e.g. Html Agility Pack) to parse the html elements from the retrieved HTML.
Another way is to use WebClient class. You can use it in threads. You can use 3'rd party libraries (e.g. Html Agility Pack) to parse the html elements from the retrieved HTML.
#3
Posted 05 September 2012 - 09:12 PM
Yes, you have to create 5 WebBrowser or (5 tab of WebBrowser?). But you can't access (update) WebBrowser from thread.
Another way is to use WebClient class. You can use it in threads. You can use 3'rd party libraries (e.g. Html Agility Pack) to parse the html elements from the retrieved HTML.
He wouldn't be able to access 5 different Yahoo accounts at the same time with 5 different webbrowsers unless he changed the proxy for each one.
I wouldn't suggest a WebBrowser anyways, because WebRequest's provide an easier way to change the proxy, and are much more suitable for sending modified POST data for navigating and retrieving data.
I wouldn't recommend a WebClient either, because you don't have free reign over POST data and cookies like you would with an HTTPWebRequest in order to maintain a login session, and as well login with your credentials to these Yahoo accounts.
~Ace
Microsoft MVP (2012) - .NET Programming | ®Crestron DMC-T Certified Programmer
#4
Posted 05 November 2012 - 04:56 PM
The way I would do it is like this:
- put your credentials in 2d array like this:
**username1**username2**username3**username4**username5**
**password 1**password 2**password 3**password4** password5**
then loop your program(with logging out) 5 time each time using the next username and pass from the array.
I don't know if this might work, just my first idea when rading your problem =)
- put your credentials in 2d array like this:
**username1**username2**username3**username4**username5**
**password 1**password 2**password 3**password4** password5**
then loop your program(with logging out) 5 time each time using the next username and pass from the array.
I don't know if this might work, just my first idea when rading your problem =)
#5
Posted 05 November 2012 - 07:06 PM
That's not a very good depiction of a 2D array... Do you mean where user and pass are in one sub dimension? or where all usernames are one, and the other are all the passwords? Why not a dictionary? Why store them as hardcoded values anyways?
A few questions I would ask firsthand.
A few questions I would ask firsthand.
Microsoft MVP (2012) - .NET Programming | ®Crestron DMC-T Certified Programmer
#6
Posted 05 November 2012 - 10:18 PM
Yes, you have to create 5 WebBrowser or (5 tab of WebBrowser?). But you can't access (update) WebBrowser from thread.
Another way is to use WebClient class. You can use it in threads. You can use 3'rd party libraries (e.g. Html Agility Pack) to parse the html elements from the retrieved HTML.
if you are serious about threading, you need to pay attention to kernelcoder's second paragraph because webbrowser is not best friends with threading... not that you can't make a couple of them to work fine, but ... is not the best alternative
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download