如何写每周时间表 [英] how to write an weekly schedular

查看:81
本文介绍了如何写每周时间表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好
我有一个问题
我有一个清单,其中包含教师姓名和教师课程以及教师班级的能力,课程名称和课程性别以及我大学中所有课程的课程性别,课程组和课程单位.
我必须编写每周向我显示时间表的程序.
例如包含周六时间表的表:

8-10 10-12 12-14 14-16 16-18
301数学历史(babaei先生)pl(sadeghi先生)... ...
302 ... ... ... ... ...
303 ... ... ... ... ...
304 ... ... ... ... ...
305 ... ... ... ... ...

行=类编号列:时间

你对我有什么想法或例子吗?
我的邮件:remove

hello
i have a question
i have a list containing teacher name and teacher course and capacity for teacher class and name of course and sex of course and course group and course unit from all courses in my university.
i have to write program that show to me weekly schedular .
for example a table that containing saturday schedular :

8-10 10-12 12-14 14-16 16-18
301 Math history(mr.babaei) pl(mr.sadeghi) ... ...
302 ... ... ... ... ...
303 ... ... ... ... ...
304 ... ... ... ... ...
305 ... ... ... ... ...

rows=class number columns : time

have you any idea or example for me.
my mail : removed

推荐答案

假设您正在编写一些需要在特定时钟时间执行某项操作的系统,则以下内容将涉及提高一个事件.

为每个要安排的事件创建一个System.Timer(包装在包含该事件参数的对象中).通过计算毫秒数来设置计时器,直到事件发生为止. EG:

Assuming you''re writing some system that needs to perform an action at a specific clock time, the following would cover the fundamental task of raising an event.

Create a System.Timer for each event to be scheduled (wrap in an object that contains the parameters for the event). Set the timer by calculating the milliseconds until the event is supposed to happen. EG:

// Set event to occur on October 1st, 2008 at 12:30pm.
DateTime eventStarts = new DateTime(2008,10,1,12,30,00);
Timer timer = new Timer((eventStarts - DateTime.Now).TotalMilliseconds);


由于您没有详细介绍,其余的一切都取决于您自己;处理timer.Elapsed事件以执行所需的操作,并将该应用程序编写为Windows Service,使其始终在后台运行.


Since you didn''t go into detail, the rest would be up to you; handle the timer.Elapsed event to do what you want, and write the application as a Windows Service to run in background always.


这篇关于如何写每周时间表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆