First you are going to need a random number. There is over 30000000 people on gaia so thats a good number to use.
So the next line is going to generate the number. This will be the user id.Code:Random random = new Random();
No "random.Next(MIN, MAX)" sets the limit.
So the first string will be the URL of a random profile. "Wrapper.Get("http://www.gaiaonline.com/profiles/" + rndid);" As you can see it adds the random number to the end of the URL.Code:Random random = new Random(); Int32 rndid = random.Next(5000, 30000000);
The second string is a Between statement, you need a wrapper that supports this.
"Wrapper.Between(Get, "http://www.gaiaonline.com/profiles/", "/");" This will look for the link on the random profile. The output of this string will most likely produce a username.
Outputing this string is easy you can use it for what ever you need to to do or just put it on a label.Code:Random random = new Random(); Int32 rndid = random.Next(5000, 25000000); String Get = Wrapper.Get("http://www.gaiaonline.com/profiles/" + rndid); String Name = Wrapper.Between(Get, "http://www.gaiaonline.com/profiles/", "/");
Code:label1.Text = Name;
Results 1 to 2 of 2
- 01 Jul. 2011 09:11pm #1
[C# + HTTP Wrappers] A Method for Random Usernames
- 01 Jul. 2011 09:19pm #2
Nice Tutorial :]