简体   繁体   English

有没有人有一个.NET程序的好例子,它保持驻留内存并在计时器上运行一个动作?

[英]Does anyone have any good examples of a .NET program that stays memory resident and runs an action on a timer?

This program should not have a visible window, more like a daemon. 该程序不应该有一个可见的窗口,更像是一个守护进程。 (a taskbar program for instance) Any links or advice will be appreciated. (例如任务栏程序)任何链接或建议将不胜感激。

You might want to consider writing a Windows Service . 您可能需要考虑编写Windows服务

If you just need to execute a specific action at certain times you could make use of the Windows Task Scheduler . 如果您只需要在特定时间执行特定操作,则可以使用Windows任务计划程序

If you want an icon in the system tray you could write an ordinary Windows Forms application but have the main form hidden until the user requests it. 如果您想要系统托盘中的图标,您可以编写一个普通的Windows窗体应用程序,但在用户请求之前隐藏主窗体。 This article explains how. 本文解释了如何。

或者,如果您想在计时器上运行任务,Windows任务计划程序就在它所在的位置。

When I've built applications that need this functionality before, I've always used the Windows Task Scheduler through a simple .NET library that I found. 当我以前构建需要此功能的应用程序时,我总是通过我找到的简单.NET库使用Windows任务计划程序

Please see my answer to a similar question for some sample code and more explanation. 有关示例代码和更多解释, 参阅我对类似问题的回答

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我想创建在列表中搜索、编辑和擦除 arrays 的方法。 有没有人有任何提示或例子? - I want to create methods to search, edit, and erase arrays in a list. Does anyone have any tips or examples? 有人对 C# 中的基本计时器有一个好主意吗? - Anyone have a good idea for a basic timer in C#? 有没有人对[Authorize]属性如何处理标准ASP.NET MVC 5应用程序中的路由有一个很好的解释? - Does anyone have a good explanation on how the [Authorize] Attribute handles routes in a standard ASP.NET MVC 5 application? 有没有人有从.Net应用程序控制多个Excel实例的好例子? - Does anyone have a good example of controlling multiple Excel instances from a .Net app? CSV导入:有人知道任何好的CSV导入工具吗? - CSV Import: Does anyone know of any good CSV importing tools? 在同一类本身中创建对象是一件好事吗? 它是否在.net中造成任何内存泄漏问题 - Is that the good thing to create object in same class itself ? does it make any memory leakage issue in .net 有谁知道用C#实现原子动作的任何方法吗? - Does anyone know any way of implementing an atomic action in C#? 任何人都有一些TAP或SNPP的例子吗? - Anyone have some TAP or SNPP examples? 关于ASP.NET MVC3操作方法的任何好的文档吗? - Any good documentation on ASP.NET MVC3 action methods? 是否有人拥有.Net Excel IO组件基准测试? - Does anyone have .Net Excel IO component benchmarks?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM