class Program { static void Main(string[] args) { //十进制转二进制 Console.WriteLine("十进制166的二进制表示: " + Convert.ToString(166, 2)); //十进制转八进制 Console.WriteLine("十进制166的八进制表示: " + Convert.ToString(166, 8)); //十进制转十六进制 Console.WriteLine("十进制166的十六进制表示: " + Convert.ToString(166, 16)); Timer t = new Timer(); t.Elapsed += new ElapsedEventHandler(writesecond); t.Interval = 1000; t.Enabled = true; Console.ReadLine(); } public static void writesecond(object source, ElapsedEventArgs e) { Console.Clear(); Console.WriteLine("当前秒数:" + DateTime.Now.ToString()); } }