Advertisement
Guest User

Untitled

a guest
Feb 28th, 2015
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. private static readonly Random random = new Random();
  2. public string randlogin(int typ)
  3. {
  4. char[] wrandom = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'i', 'k', 'l', 'm', 'n', 'o', 'p', 'r', 's', 't', 'u', 'v', 'x', 'w', 'y', 'z','0','1','2','3','4','5','6','7','8','9' };
  5.  
  6. string random_string = " ";
  7.  
  8. random_string = random_string.Remove(random_string.Length - 1);
  9. random_string += wrandom[random.Next(0, 24)].ToString();
  10. int count = 0;
  11. if (typ == 1)
  12. {
  13. count = random.Next(10, 17);
  14. }
  15. else
  16. {
  17. count = random.Next(8, 10);
  18. }
  19. for (int i = 0; i < count; i++)
  20. {
  21. random_string += wrandom[random.Next(0, 34)].ToString();
  22. }
  23. return random_string;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement