(adsbygoogle = window.adsbygoogle || []).push({});
Hello ngu today i will show you guys how to make a console application in C# to type random letters(this is comming from my upcomming project that i have been working on).
First things first you want to create a console application.(name it anything you want )
Step2: we are going to need system.threading, system.windows.forms(for this one you need to find the reference),
and system media.
You must login or register to view this content.
Step3: we're going to want to create a definition(For the noobs out there type the code below class program).
public static Random _random = new Random();
You must login or register to view this content.
Step4: we are going to name this console application anything we want, so under static void main(string[] args)
type: Console.WriteLine("Name this part anything you want")
You must login or register to view this content.
Step5: lets create the thread for out auto typer
Thread autoTyper = new Thread(new ThreadStart(AutoTyper));
now this leaves you with an error, lets fix this error
Step6:
public static void AutoType()
{
while (true)
{
char key = (char)(_random.Next(25) + 65);
if (_random.Next(2) == 0)
{
key = char.ToLower(key);
}
SendKeys.SendWait(key.ToString());
Thread.Sleep(_random.Next(500));
}
step7: now lets go back up to where the newly created thread was,
we now need to tell this to run and when to stop.
You must login or register to view this content.
Now lets debug it, and the finish product should just start typing random letters(to stop it just press enter on your keyboard).