針對一個程序,新建一個計劃,計劃里面有多個操作,每個操作都有參數。以時間的方法觸發執行,就是執行不了啊。求解?。?
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 關注
- 318 瀏覽
添加回答
舉報
0/150
提交
取消
