- implement argon2 hashing for SecureString (Does not work yet)
- implement asciit text
Console.WriteLine("Hello World", new Color(ConsoleColor.Green));
var password = Console.ReadPassword("Password: ");
var answer = Console.BoolQuestion("Would you like to continue?");
Console.WriteLine(answer);
var options = new Options(new[]
{
"Option 1",
"Option 2",
"Option 3"
});
var index = Console.SelectOption(options);
Console.WriteLine(index);
var lines = new[]
{
"Firstname",
"Lastname"
};
var values = Console.Form(lines);
Console.WriteLine(values[0]);
Console.WriteLine(values[1]);
Console.SetColor(new Color(ConsoleColor.Blue));
Console.WriteLine("This text should be blue");
Console.WriteLine("And this one too");
In the Color class you can define a fore- and or background color.
(Pretty self explaining)
var color = new Color(ConsoleColor.DarkBlue, ConsoleColor.DarkGray);
Note: You can use this Color in pretty much every other Console function.
With the Write function you can write text to the console and color it. This command will not make a new line in the console!
Console.Write("Text", color);
This function is exactly the same as Write, except it does make a new line after it.
Console.Write("Text with new line", color)
This function is like the one in System.Console. But here you can ask for something too.
var answer = Console.ReadLine();
//or
var answer = Console.ReadLine("Username: ", color);
This one is completly like the one in System.Console.
var key = Console.ReadKey();
With this function you can ask for a Password that is returned as SecureString.
var pass = Console.ReadPassword();
//or
var pass = Console.ReadPassword("Password: ", color, passColor);
With this function you can ask a yes/no question with a default value.
(yes = true, no = false)
var answer = Console.BoolQuestion("Would you like to continue?", def, color);
With this function you can select from a string[] of options. Returned will be the index of the array. To select a option, move with the arrow keys and press enter.
var options = new[]
{
"Option 1",
"Option 2",
"Option 3"
};
var index = Console.SelectOption(options);
Console.WriteLine(index);
With this function you can create a Form where users can input variables for multiple lines. To edit a field, select it with your arrow keys and and press enter. Now you can write.
var lines = new[]
{
"Firstname",
"Lastname"
};
var values = Console.Form(lines);
Console.WriteLine(values[0]);
Console.WriteLine(values[1]);
This function waits for any key to press. You can enable or disable the message in the params.
Console.AwaitAnyKey();
This function is like the AwaitAnyKey function, but it only waits for the enter key.
Console.AwaitEnter();
With this function you can clear the whole console.
Console.WriteLine("Hello");
Console.WriteLine("World");
Console.Clear();
With this function you can clear a specific line.
Console.WriteLine("Hello");
Console.WriteLine("World");
Console.ClearLine(0);
With this function you can overwrite any line in the console.
Console.WriteLine("Hello");
Console.WriteLine("World");
Console.OverwriteLine(0, "Overwritten");
Read an validate a email.
var email = Console.ReadEmail();
Checks if the email is plausable.
var isValid = Console.IsValidEmail(email);
Sends a email verification code to a specific email and checks it in the console. For this you need a google email (fromEmail), where you have to create a appPassword for.
var isValid = Console.OptVerification(email, fromEmail, appPassword);
With this function you can get the current console color.
var color = Console.GetColor();
With this function you can set the current console color.
Console.SetColor(color);
Get and set the CursorTop.
Console.CursorTop(0);
var top = Console.CursorTop();
Like the CursorTop you can get and set its position.
Console.CursorLeft(0);
var left = Console.CursorLeft();
Width this function you can get the BufferWidth.
var width = Console.BufferWidth();
Width this function you can get the BufferHeight.
var height = Console.BufferHeight();
This project has a MIT License: license
If you have any question please write to me on discord because im not that often on github.
ImGajeed76#5617