求C#定时控制按键
我想用C#写程序控制键盘输入,比如定时一秒钟按一下1键,然后过1秒再按一下2键,然后过1秒再按1键,现在就是不太清楚C#如何可以控制键盘按键,知道的高手帮帮忙,谢谢了
------解决方案--------------------和本FORM无关的,不一定就要写在FORM上! 
 这样的,你写个类调用StartTimer方法,启动类之后一样可以输出同样的结果! 
         public void StartTimer() 
         { 
             Timer timer = new Timer(); 
             timer.Interval = 1000; 
             timer.Start(); 
         } 
         private int num = 0; 
         private void timer_Tick(object sender, EventArgs e) 
         { 
             if (num == 0) 
             { 
                 SendKeys.Send( "1 "); 
                 num = 1; 
             } 
             else if (num == 1) 
             { 
                 SendKeys.Send( "2 "); 
                 num = 2; 
             } 
             else if (num == 2) 
             { 
                 SendKeys.Send( "3 "); 
                 num = 3; 
             } 
             else 
             { 
                 timer1.Stop(); 
             }   
         }