我有一个Windows窗体应用程序 并安装在两个以上的系统中 在局域网中或在网络中说. 在中进行了任何修改时 主模块.更新已发送 使用Windows来访问每个系统 服务在每个系统中在后台运行. 当更新到达特定系统时 notifyIcon通知用户更新 可用,然后开始更新. 更新是根据app.config文件中设置的updateinterval时间安排的, 是xml文件.我们可以手动设置更新间隔 应该开始. 现在我要在这里 用户界面,以便 用户可以通过设置一天和一周中的特定时间,将服务安排为每日",每小时",每周"和现在"选项. 如我们所见,在Java更新的情况下,有一个系统任务栏图标.右键单击该图标会显示更新/计划选项. 我想要一些功能相同的功能.我想着上下文菜单,但是我应该如何设置时间间隔. 任何示例或想法. 请提供帮助.
I have a windows form application and is installed in more than two systems in LAN or say in network. When Any modification is done in the Main Module. Updates are sent to each system using a windows service which run in background in every system. When update reaches to particular system a notifyIcon notifies the user that updates are available ,and then updating starts. Updation is scheduled as per the updateinterval time set in the app.config file which is a xml file .There we can Set manually the interval after which the updation should start. Now I want here that a user Interface so that user can schedule the service as Daily ,Hourly,weekly and Now options by setting a specific time of the day and week. As we all have seen in case of Java updates .There is a system tray Icon.On right clicking the Icon it shows the Updation/scheduling options. I want the some how the same Functionality .Am thinking of Context menu ,but how should i set the Time Interval. Any Examples or Idea. Please assist.
推荐答案当然,您可以在服务中使用计时器并计算适当的时间以启动计划的操作.应基于当前时间(System.DateTimeNow)计算时序.但是,您也可以使用Windows中已经可用的外部服务. 它已经与Windows捆绑在一起并启用了;您可以在不同级别上使用它.它称为窗口任务计划程序",请参见 en.wikipedia/wiki/Windows_Task_Scheduler [ ^ ]. 首先,您可以使用命令行实用程序AT.EXE或CSHTASKS.EXE(将替换AT.EXE)来安排事件,请参见: en.wikipedia/wiki/At_%28Windows%29 [ ^ ], en.wikipedia/wiki/Schtasks [ ^ ], technet.microsoft/en-us/library/bb490866.aspx [ ^ ], msdn.microsoft/zh-我们/library/windows/desktop/bb736357%28v=vs.85%29.aspx [ ^ ]. 您还可以使用Window Task Scheduler API,请参见: msdn.microsoft/zh-我们/library/windows/desktop/aa383614%28v=vs.85%29.aspx [ ^ ], msdn.microsoft/zh-我们/library/windows/desktop/aa383608%28v=vs.85%29.aspx [ ^ ]. 若要查看如何将其与.NET结合使用,请参见此CodeProject文章: .NET的新任务计划程序类库 [ ^ ].
更多推荐
每天,每周,每周为Windows服务创建Scheduler
发布评论