我寫了case one跟case two 都寫在同一個 school.cs
下面是我的app.config
private void schoolp()
{
try
{
var schedule = GetSchedule();
Log.Info($"Start Data");
CASEONE();
CASETWO();
GC.Collect();
Log.Info($"Start Data");
CASEONE();
CASETWO();
GC.Collect();
Log.Info($"Stop Data");
}
}
catch (Exception ex)
{
Log.Error(ex);
}
}
...
private void CASEONE()
{
Log.Info("Start CASEONE");
SSDPbase dbbase = new schoolbase();
.....
}
private void CASETWO()
{
Log.Info("Start CASETWO");
school dbbase = new schoolbase();
.....
}
中間有省略 這算一個發信功能 要如何在app.config裡給予參數判斷
而case one 、 two 只要用 DayOfWeek 給予if=星期幾config增加參數判斷就能嗎?
case one 星期三啟動
case two 每天啟動