Advertisement
Neo-Craft

Tenesiz

Oct 29th, 2012
417
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.33 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using System.Net;
  5. using System.Diagnostics;
  6. using System.IO;
  7. using System.Threading;
  8.  
  9. namespace testttttttt
  10. {
  11.     class Program
  12.     {
  13.         static public Account c;
  14.         const string _chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  15.         static private readonly Random _rng = new Random();
  16.         static void Main(string[] args)
  17.         {
  18.             while (true)
  19.             {
  20.                 Boolean isPosted = true;
  21.                 Console.Title = i + " Account Created";
  22.                 Stopwatch sw = new Stopwatch();
  23.                 sw.Start();
  24.                 new Account();
  25.                 Console.WriteLine(c.Name + " " + c.Pass + " " + c.Mail + " " + c.Pseudo + " " + c.Question + " " + c.Answer);
  26.                 try
  27.                 {
  28.                     createAccount();
  29.                 }
  30.                 catch (Exception e) { isPosted = false; };
  31.                 if (isPosted)
  32.                 {
  33.                     sw.Stop();
  34.                     Console.WriteLine("Account Created successfully in : " + (int)sw.Elapsed.TotalMilliseconds + " Milliseconds");
  35.                 }
  36.             }
  37.             Console.ReadLine();
  38.         }
  39.         static void createAccount()
  40.         {
  41.             try
  42.             {
  43.                 HttpWebRequest Request;
  44.                 HttpWebResponse Reponse;
  45.                 String Link = "https://tenesiz.eu/register";
  46.                 string data = "username=" + c.Name + "+&password=" + c.Pass + "&password_validation=" + c.Pass + "&email=" + c.Mail + "&pseudo=" + c.Pseudo + "&question=" + c.Question + "&response=" + c.Answer;
  47.                 String PostData = "submit";
  48.                 Request = (HttpWebRequest)(WebRequest.Create(Link));
  49.                 Request.ContentType = "application/x-www-form-urlencoded";
  50.                 Request.ContentLength = data.Length;
  51.                 Request.Method = "POST";
  52.                 Request.AllowAutoRedirect = false;
  53.                 Request.Timeout = 3000;
  54.                 Stream RequestStream = Request.GetRequestStream();
  55.                 byte[] postBytes = Encoding.ASCII.GetBytes(data);
  56.                 RequestStream.Write(postBytes, 0, postBytes.Length);
  57.                 RequestStream.Close();
  58.                 Reponse = (HttpWebResponse)(Request.GetResponse());
  59.             }
  60.             catch (Exception e) { throw e; };
  61.         }
  62.         public class Account
  63.         {
  64.             public String Name;
  65.             public String Pass;
  66.             public String Mail;
  67.             public String Pseudo;
  68.             public String Question;
  69.             public String Answer;
  70.  
  71.             public Account()
  72.             {
  73.                 this.Name  = getRamdomString(7);
  74.                 this.Pass = getRamdomString(8);
  75.                 this.Mail = getRamdomString(6)+"@hotmail.com";
  76.                 this.Pseudo = getRamdomString(7);
  77.                 this.Question = getRamdomString(8);
  78.                 this.Answer = getRamdomString(7);
  79.             }
  80.  
  81.         }
  82.  
  83.         static public String getRamdomString(int size)
  84.         {
  85.             char[] buffer = new char[size];
  86.  
  87.             for (int i = 0; i < size; i++)
  88.             {
  89.                 buffer[i] = _chars[_rng.Next(_chars.Length)];
  90.             }
  91.             return new string(buffer).ToLower();
  92.         }
  93.     }
  94. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement