1
Is there any available function or method to Restart the application on the C console#?
static void decision()
{
Console.WriteLine("\n Press the home key to recalculate. . .", Console.ForegroundColor = ConsoleColor.Blue);
Console.ResetColor();
Console.WriteLine(" Press the esc key to exit. . .", Console.ForegroundColor = ConsoleColor.Magenta);
Console.ResetColor();
var option = Console.ReadKey();
if (option.Key == ConsoleKey.Escape)
{
Environment.Exit(0);
}
else if (option.Key == ConsoleKey.Home)
{
/* reiniciar aplicação console aqui */
}
else
{
Console.Clear();
Console.WriteLine("\n Invalid option, try again!", Console.ForegroundColor = ConsoleColor.Red);
Console.ResetColor();
decision();
}
}
What is restarting the application? Better say what you need instead of trying to do something random, you probably don’t need what you’re asking.
– Maniero