针对一个程序,新建一个计划,计划里面有多个操作,每个操作都有参数。以时间的方法触发执行,就是执行不了啊。求解!!
2 回答
白衣染霜花
TA贡献1796条经验 获得超10个赞
参数是直接可由args 获取就行了。对控件台应用程序不熟悉啊。
class Program
{
static void Main(string[] args)
{
string para1=(string)args.GetValue(0);
}
}
慕雪6442864
TA贡献1812条经验 获得超5个赞
具体什么错误,把代码贴出来。先参考一下我这:
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); } }
- 2 回答
- 0 关注
- 300 浏览
添加回答
举报
0/150
提交
取消