当前位置: 代码迷 >> .NET面试 >> 一道小题目,大家帮小弟我做一下,没学过c#求完全代码,
  详细解决方案

一道小题目,大家帮小弟我做一下,没学过c#求完全代码,

热度:91   发布时间:2016-05-02 20:22:14.0
一道小题目,大家帮我做一下,没学过c#,求完全代码,在线等!
一道简单的题目,在线等答案,设计一个类,要求用事件每10秒报告机器的当前时间。各位大侠帮帮忙吧!谢谢

------解决方案--------------------
C# code
namespace ConsoleApplication1{    public class Program    {        public static void Main()        {            MyTimer timer = new MyTimer();            timer.Interval = 1000;            timer.Elapsed += delegate(object sender, System.Timers.ElapsedEventArgs e)            {                Console.WriteLine(System.DateTime.Now);            };            timer.Start();            Console.ReadKey();        }    }    public sealed class MyTimer : System.Timers.Timer    {    }}
------解决方案--------------------
探讨

C# code
namespace ConsoleApplication1
{
public class Program
{
public static void Main()
{
MyTimer timer = new MyTimer();
timer.Interval = 1000;
……
  相关解决方案