using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
          /*  string a, b;
            a = "你";
            b = "好";
            
            Console.Title = "我的第一个应用程序";     //标题
            Console.BackgroundColor = ConsoleColor.Blue;  //背景色改为蓝色
            Console.WriteLine("请输入你的名字,按回车确认!");  //输出
                string name=Console.ReadLine();
                Console.WriteLine(a + b + "," + name);
                a = Console.ReadLine();       //任意输入a,b
               b = Console.ReadLine();
            Console.WriteLine(a + b + "," + name);
               Console.ReadKey();
           int a, b;
            a = int.Parse(Console.ReadLine());     //类型转换
            b = int.Parse(Console.ReadLine());
            Console.WriteLine((a + b).ToString());
            Console.ReadKey();
           
           int a, b;
            a = Convert.ToInt32(Console.ReadLine());    //类型转换
            b = Convert.ToInt32(Console.ReadLine());
            Console.WriteLine(a + "个苹果加上" + b + "个苹果等于" + (a + b) + "个苹果");
            Console.ReadKey();*/
            DateTime d;
            d = DateTime.Now;
            Console.WriteLine(d);   //输出当前时间
            Console.WriteLine(d.ToString("yyyy年MM月dd日   hh : mm : ss "));    //按此类格式输出时间
            Console.ReadKey();
        }
    }
}
原文:http://www.cnblogs.com/William-1234/p/4304656.html