系统托盘应用程序来控制 Windows 服务
我创建了一个 Windows 服务来启动日常流程,并且还创建了一个系统托盘应用程序(换句话说,一个显示系统托盘图标和上下文菜单的 win 表单应用程序)来控制该 Windows 服务。上下文菜单还显示上次运行的结果和下一次的运行时(启动时间有一个随机元素,如 anacrontab)
我正在努力解决的问题是,如何确保系统托盘应用程序运行时间:
安装了服务 & 用户登录(远程)
我知道启动文件夹,但它似乎有点点头。还有其他办法吗?
I have created a windows service to kick off a daily process and I also have created a system tray app (in other words, a win form app that displays system tray icon with a context menu) to control this windows service. The context menu also shows the result of the last run and the runtime for the next time (there is a random element to the start time a la anacrontab)
The issue I'm struggling with is, how do I make sure that the system tray app runs when:
The service is installed
&
a user logs in (remotely)
I know about the Startup folder, but it seems a little bit noddy. Is there any other way?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您希望系统托盘应用程序在无人登录时运行吗?
我认为你应该尝试启动,如果你发现任何问题,那么就去解决。
我也在做类似的事情,但我有不同的问题。
Do you want that system tray application to run when none is logged in???
i think you should try with startup thing and if you found any problem then go for work around.
i am also working on similar thing but i have different problem.
我也处于同样的情况,是的,启动文件夹在 2021 年仍然不可靠
。根据我的经验,Windows 任务计划程序是最可靠的方法。您可以将其配置为在登录时或在许多其他支持的事件之一上运行任何内容:
I'm in the same situation, and yes, Startup folder is still unreliable in 2021.
From my experience, Windows Task Scheduler is the most reliable way. You can configure it to run anything on Logon, or on one of many other supported events: