mardi 15 novembre 2016

C# Date and time help please?

I am trying to make a dialog in C# console... and I try to make it answer the users's question:

"tell me the date and time"

or something like that. This is my code:

resp3 = Console.ReadLine();
if (resp3 == "tell me the curent date and time")
{
    Console.Write(string.Format("{0:HH:mm:ss tt}", DateTime.Now));
}

After it writes the answer to the console, it just closes.

Aucun commentaire:

Enregistrer un commentaire