首页 新闻 会员 周边

控制台程序怎么接受window 计划里面的程序啊

0
悬赏园豆:30 [已解决问题] 解决于 2012-06-27 21:21

针对一个程序,新建一个计划,计划里面有多个操作,每个操作都有参数。

以时间的方法触发执行,就是执行不了啊。求解!!

乐上的主页 乐上 | 初学一级 | 园豆:8
提问于:2012-04-24 11:07
< >
分享
最佳答案
0

参数是直接可由args 获取就行了。对控件台应用程序不熟悉啊。

class Program
{
static void Main(string[] args)
{
string para1=(string)args.GetValue(0);
}
}

乐上 | 初学一级 |园豆:8 | 2012-06-27 17:26
其他回答(1)
0

具体什么错误,把代码贴出来。先参考一下我这:

class Parent
{
  List<Child> _children = new List<Child>();

  public Parent()
  {
    _children.Add(new Child());
    _children.Add(new Child());
    _children.Add(new Child());

    // Add handler to the child event
    foreach (Child child in _children)
    {
      child.TimerFired += Child_TimerFired;
    }
  }

  private void Child_TimerFired(object sender, EventArgs e)
  {
    // One of the child timers fired
    // sender is a reference to the child that fired the event
  }
}

class Child
{
  public event EventHandler TimerFired;

  protected void OnTimerFired(EventArgs e)
  {      
    if (TimerFired != null)
    {
      TimerFired(this, e);
    }
  }

  // This is the event that is fired by your current timer mechanism
  private void HandleTimerTick(...)
  {
    OnTimerFired(EventArgs.Empty);
  }
}
收获园豆:30
悟行 | 园豆:12559 (专家六级) | 2012-04-24 12:49
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册