Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.IO;
- namespace GenerátorVariant
- {
- class Program
- {
- static StreamWriter sw;
- static string Cesta = @"D:\temp\";
- static String NazevSouboru = "Hesla_0.txt";
- static int Pocet = 0;
- static Int64 Zaznamu = 0;
- static void Main(string[] args)
- {
- if (!Directory.Exists(Cesta))
- {
- Directory.CreateDirectory(Cesta);
- }
- sw = new StreamWriter(Cesta + "Hesla_0.txt", false);
- char[] heslo = new char[10];
- for (int a = 33; a < 126; a++)
- {
- for (int b = 33; b < 126; b++)
- {
- for (int c = 33; c < 126; c++)
- {
- for (int d = 33; d < 126; d++)
- {
- for (int e = 33; e < 126; e++)
- {
- for (int f = 33; f < 126; f++)
- {
- for (int g = 33; g < 126; g++)
- {
- for (int h = 33; h < 126; h++)
- {
- for (int i = 33; i < 126; i++)
- {
- for (int j = 33; j < 126; j++)
- {
- heslo[0] = (char)a;
- heslo[1] = (char)b;
- heslo[2] = (char)c;
- heslo[3] = (char)d;
- heslo[4] = (char)e;
- heslo[5] = (char)f;
- heslo[6] = (char)g;
- heslo[7] = (char)h;
- heslo[8] = (char)i;
- heslo[9] = (char)j;
- Vypis(heslo);
- Zaznamu++;
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- sw.Close();
- Console.WriteLine("Hotovo!");
- Console.ReadKey();
- }
- static void Vypis(char[] Vstup)
- {
- string Vystup = "";
- foreach (char a in Vstup)
- {
- Vystup += a;
- }
- if (Zaznamu % 5000000 == 0)
- {
- FileInfo FI = new FileInfo(Cesta + NazevSouboru);
- if (FI.Length > (Int32.MaxValue / 4))
- {
- Pocet++;
- NazevSouboru = "Hesla_" + Pocet + ".txt";
- sw = new StreamWriter(Cesta + NazevSouboru, false);
- Zaznamu = 0;
- }
- }
- sw.WriteLine(Vystup);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement