You can use this to create a keygen, random string, etc etc...
PHP Code:
public string Random_String(int Length)
{
Random random = new Random();
string characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
string rand = string.Empty;
for (int i = 0; i < Length; i++)
{
rand += characters[random.Next(0, characters.Count())];
}
return rand;
}
Results 1 to 5 of 5
Thread: [C#] Random String
- 05 Feb. 2011 05:41pm #1
[C#] Random String
- 05 Feb. 2011 11:00pm #2
a more appropriate characters string would be
Code:string characters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
---------- Post added at 06:00 PM ---------- Previous post was at 06:00 PM ----------
a more appropriate characters string would be
Code:string characters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
- 06 Feb. 2011 02:50am #3
Nice work
It's simple and effective.Shh, I'm watching My little pony.
- 06 Feb. 2011 04:32am #4
- 06 Feb. 2011 04:55am #5