Advertisement
Guest User

xMinecraft Source Code

a guest
Jul 21st, 2015
253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 4.19 KB | None | 0 0
  1. using System;
  2. using System.Windows.Forms;
  3. using System.Net;
  4. using System.Text.RegularExpressions;
  5. using Microsoft.VisualBasic.FileIO;
  6. using System.Collections.Generic;
  7. internal static class xMinecraft
  8. {
  9.     private static WebClient wc = new WebClient();
  10.     private static List<string> gen = new List<string>();
  11.     private static int Count;
  12.     public static void Main()
  13.     {
  14.         Console.Title = "xMinecraft - Fast minecraft account generator";
  15.         Console.ForegroundColor = ConsoleColor.Green;
  16.         Console.WriteLine("       __  __ _                            __ _   ");
  17.         Console.WriteLine("      |  \\/  (_)                          / _| |  ");
  18.         Console.ForegroundColor = ConsoleColor.White;
  19.         Console.WriteLine(" __  _| \\  / |_ _ __   ___  ___ _ __ __ _| |_| |_ ");
  20.         Console.WriteLine(" \\ \\/ / |\\/| | | '_ \\ / _ \\/ __| '__/ _` |  _| __|");
  21.         Console.ForegroundColor = ConsoleColor.Red;
  22.         Console.WriteLine("  >  <| |  | | | | | |  __/ (__| | | (_| | | | |_ ");
  23.         Console.WriteLine(" /_/\\_\\_|  |_|_|_| |_|\\___|\\___|_|  \\__,_|_|  \\__|");
  24.         Console.ForegroundColor = ConsoleColor.DarkGray;
  25.         Console.WriteLine();
  26.         Console.WriteLine(" Simple Minecraft account generator open-source " + Environment.NewLine + "         by @srsly from Inforge.net");
  27.         Console.WriteLine();
  28.         Console.Write("How many accounts would you like to make? ");
  29.         string accs = Console.ReadLine();
  30.         if (IsNumeric(accs))
  31.         {
  32.             GenAccs(Convert.ToInt32(accs));
  33.         }
  34.         else
  35.         {
  36.             MessageBox.Show("Not numeric!", "xMinecraft", MessageBoxButtons.OK, MessageBoxIcon.Error);
  37.         }
  38.     }
  39.  
  40.     public static void GenAccs(int number)
  41.     {
  42.         string pattern = "([A-Za-z0-9_.+-]+@(?:[A-Za-z-0-9])+\\.[a-za-z0-9]{2,10}:(?:[A-Za-z0-9]{3,}))";
  43.         Console.ForegroundColor = ConsoleColor.Green;
  44.         for (var i = 0; i < number; i++)
  45.         {
  46.             try
  47.             {
  48.                 string strPage = wc.DownloadString("http://www.crackedminecraft.net/freeaccounts.php");
  49.                 MatchCollection mc = Regex.Matches(strPage, pattern);
  50.                 foreach (Match m in mc)
  51.                 {
  52.                     Console.WriteLine("#{0} - {1}", Count + 1, m);
  53.                     gen.Add(m.ToString());
  54.                     Count += 1;
  55.                 }
  56.             }
  57.             catch (Exception Ex)
  58.             {
  59.                 Console.ForegroundColor = ConsoleColor.Red;
  60.                 Console.WriteLine(Ex.Message);
  61.                 Console.ForegroundColor = ConsoleColor.DarkGray;
  62.             }
  63.         }
  64.         Console.ForegroundColor = ConsoleColor.DarkGray;
  65.         Console.WriteLine();
  66.         Console.WriteLine(Count + " accounts generated successfully!");
  67.         Console.Write("Do you want to save them on your Desktop? (y/n) ");
  68.         string reply = Console.ReadLine();
  69.         if (reply.ToLower() == "y")
  70.         {
  71.             try
  72.             {
  73.                 string p = SpecialDirectories.Desktop + "\\xMinecraftList.txt";
  74.                 int fn = Microsoft.VisualBasic.FileSystem.FreeFile();
  75.                 Microsoft.VisualBasic.FileSystem.FileOpen(fn, p, Microsoft.VisualBasic.OpenMode.Output, Microsoft.VisualBasic.OpenAccess.Default, Microsoft.VisualBasic.OpenShare.Default, -1);
  76.                 Microsoft.VisualBasic.FileSystem.FileClose();
  77.                 System.IO.StreamWriter ow = new System.IO.StreamWriter(p, true);
  78.                 for (var i = 0; i < gen.Count; i++)
  79.                 {
  80.                     ow.WriteLine(gen[i]);
  81.                 }
  82.                 ow.Close();
  83.                 MessageBox.Show("All accounts are now saved on a text file!", "xMinecraft", MessageBoxButtons.OK, MessageBoxIcon.Information);
  84.             }
  85.             catch (Exception Ex)
  86.             {
  87.                 Console.ForegroundColor = ConsoleColor.Red;
  88.                 Console.WriteLine(Ex.Message);
  89.                 Console.ForegroundColor = ConsoleColor.DarkGray;
  90.             }
  91.         }
  92.     }
  93.         static bool IsNumeric(this string s)
  94.         {
  95.             float output;
  96.             return float.TryParse(s, out output);
  97.         }
  98.  
  99. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement