一下是源程序的代码,
但是不知道为什么,好像没有执行WriteChar中的任务?
...............................................
using System;
using System.Timers;namespace _01_Time
{
/// <summary>
/// Class1 的摘要说明。
/// </summary>
class Class1
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
/// 
static int counter=1;
static string displayString="This String will appear one letter at a time";
[STAThread]
static void Main(string[] args)
{
//
// TODO: 在此处添加代码以启动应用程序
//
Timer MyTimer =new Timer(100);
MyTimer.Elapsed+=new ElapsedEventHandler(WriteChar);
MyTimer.Start();
Console.WriteLine();
}

static void WriteChar(object source,ElapsedEventArgs e)
{
Console.WriteLine(displayString[counter++%displayString.Length]);
Console.WriteLine("Nothing Happend now!");
}
}
}