[C#] Console รับ Input ชื่อแสดงทางจอ

โค้ด

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            string strRead = "";
            Console.Write("Please insert your name : ");
            strRead = Console.ReadLine(); //get input 
            Console.WriteLine("Hello Mr./Ms. : " + strRead); //display statement 
            Console.WriteLine();
            Console.WriteLine(); 
            Console.WriteLine("Press any key to exit program.");
            Console.ReadLine();
        }
    }
}
Previous
Next Post »