Beispiel #1
0
        public static void insertJustPassword()
        {
            RainbowEntities rainbowEntities = new RainbowEntities();
            BulksPassword   bulksPassword   = new BulksPassword();
            String          result;
            int             k = 0;

            int[] vector = new int[] { 0, 0, 0, 0, 0 };

            Stopwatch stopWatch = new Stopwatch();

            stopWatch.Start();



            while (k >= 0)
            {
                if (check(vector[k]) == 1)
                {
                    vector[k] = 97;
                }
                else
                {
                    vector[k]++;
                }

                if (k != 4 && check(vector[k]) == 0)
                {
                    k++;
                }
                else
                if (check(vector[k]) == 0)
                {
                    char[] list = new char[] { (char)vector[0], (char)vector[1], (char)vector[2], (char)vector[3], (char)vector[4] };
                    result = new string(list);
                    if ((char)vector[0] == (char)vector[1] && (char)vector[0] == (char)vector[2] && (char)vector[0] == (char)vector[3] && (char)vector[0] == (char)vector[4])
                    {
                        Console.WriteLine(result);
                    }
                    //  Console.WriteLine(result);

                    bulksPassword.Pass = result;
                    rainbowEntities.BulksPasswords.Add(bulksPassword);


                    if (result == "zzzzz")
                    {
                        k = -1;
                    }
                }



                else
                {
                    k--;
                }
            }



            rainbowEntities.SaveChanges();
            stopWatch.Stop();
            TimeSpan ts          = stopWatch.Elapsed;
            string   elapsedTime = String.Format("{0:00}:{1:00}", ts.Minutes, ts.Seconds);

            Console.WriteLine("Timpul(Minute:Secunde)" + elapsedTime);
        }
Beispiel #2
0
        public static void BulkInsertIntoBulksPassword()
        {
            Stopwatch stopWatch = new Stopwatch();

            stopWatch.Start();

            var context = new RainbowEntities();

            String result;
            int    k = 0;

            int[] vector = new int[] { 0, 0, 0, 0, 0 };
            List <BulksPassword> list = new List <BulksPassword>();

            while (k >= 0)
            {
                if (check(vector[k]) == 1)
                {
                    vector[k] = 97;
                }
                else
                {
                    vector[k]++;
                }

                if (k != 4 && check(vector[k]) == 0)
                {
                    k++;
                }
                else
                if (check(vector[k]) == 0)
                {
                    char[] list2 = new char[] { (char)vector[0], (char)vector[1], (char)vector[2], (char)vector[3], (char)vector[4] };
                    result = new string(list2);
                    if ((char)vector[0] == (char)vector[1] && (char)vector[0] == (char)vector[2] && (char)vector[0] == (char)vector[3] && (char)vector[0] == (char)vector[4])
                    {
                        Console.WriteLine(result);
                    }
                    //  Console.WriteLine(result);

                    BulksPassword obj = new BulksPassword();
                    obj.Pass = result;
                    list.Add(obj);

                    if (result.Equals("zzzzz"))
                    {
                        k = -1;
                    }
                }



                else
                {
                    k--;
                }
            }
            context.BulkInsert(list);
            context.SaveChanges();

            stopWatch.Stop();
            TimeSpan ts          = stopWatch.Elapsed;
            string   elapsedTime = String.Format("{0:00}:{1:00}", ts.Minutes, ts.Seconds);

            Console.WriteLine("Timpul(Minute:Secunde)" + elapsedTime);
        }