I am just learning C#
how to clear a cmd line after wrong entry like wrong user name or password in C sharp?
my codes here, have a look thanks
----------------------------------------
using System;
using System.Collections.Generic;
using System.Text;
namespace DisplayLogin
{
class Program
{
static void Main()
{
Console.WriteLine("________________________________________________");
Console.WriteLine("");
{
AdminName();
}
Console.WriteLine("");
}
static void AdminName()
{
Console.Write("\tAdmin name:");
string adminName = Console.ReadLine();
if (adminName == "user")
{
Console.WriteLine("");
PassWord();
}
else
{
Console.WriteLine("");
Console.WriteLine("\tInvalid Entry! Try again");//I need to clear all previous entry
Console.WriteLine("");
AdminName();
}
}
static void PassWord()
{
Console.Write("\tPassword:");
string passWord = Console.ReadLine();
if (passWord == "123456")
{
Console.WriteLine("");
Console.WriteLine("________________________________________________");
Console.WriteLine("");
//CreateAccount();
}
else
{
Console.WriteLine("");
Console.WriteLine("\tInvalid Password! Try again");//I need to clear all previous entry
Console.WriteLine("");
PassWord();
}
}
}
}