Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Threading;
- namespace SomeCode
- {
- class Program
- {
- static Thread Thread01 = new Thread(Generate);
- static void Main(string[] args)
- {
- string Title = "Eddy^CZ 2018";
- string Welcome = "Welcome in my random generator";
- Console.Title = Title;
- Console.ForegroundColor = ConsoleColor.Cyan;
- Console.WriteLine(Welcome);
- Thread01.IsBackground = true;
- Thread01.Start();
- Console.ReadKey();
- }
- static void Generate()
- {
- var Random = new Random();
- int Lenght = (int)byte.MaxValue;
- for (int i = 0; i < Lenght; i++)
- {
- Thread.Sleep(1000);
- var Buffer = new byte[sizeof(UInt64)];
- Random.NextBytes(Buffer);
- var Number = BitConverter.ToUInt64(Buffer, 0);
- Console.WriteLine(Number);
- }
- Console.WriteLine("Thread is ended!");
- Thread01.Abort();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement