运行程序时,Windows启动(登录前) [英] Running a program when Windows Boots (before Login)

查看:412
本文介绍了运行程序时,Windows启动(登录前)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道是否有可能在Windows登录之前运行我的应用程序?它实际上是一个WinForm应用程序($ P $比Windows服务pferably等)。

I wonder is it possible to run my application before login on windows.? Its actually a WinForm application(Preferably other than Windows service).

我的意思是我的应用程序必须运行,即使在日志中之前,它应该坐在系统托盘从中我能秀或开放接口的用户。

I mean my application must be running even before log in and it should sit on System Tray from which I can "show" or open Interface for user.

推荐答案

要有:

  • 在系统启动和用户登录的事情发生
  • 在通知区域的图标供用户进行交互

您的必须的打破你的应用程序分为两个独立的组件。其中之一将是一个WinForms / WPF应用程序,它提供了通知区域图标,并允许与之交互的用户。其他将是一个Windows服务,或者可能是一个计划任务。

You must break your application up into two separate components. One of these will be a WinForms/WPF application which provides the notification area icon and allows the user to interact with it. The other will be a Windows Service, or possibly a scheduled task.

一旦你做到了这一点,Windows服务可以集中精力做任何需要事先做登录和通知区域应用程序可以承担显示结果,或任何其他最终用户的责任。

Once you've done this, the windows service can focus on doing whatever needs to be done prior to logon and the notification area application can assume responsibility for showing the results, or whatever else to the end user.

要回答你的意见就提出从事件日志读取数据的问题,是的,这是可能的。这里对于其他问题,这将给你特定的答案:

To answer the question you posed in comments regarding reading data from the Event Log, yes this is possible. There are other questions on here which will give you that particular answer:

  • <一个href="http://stackoverflow.com/questions/2713456/read-the-windows-event-log-by-particular-source">read通过特定源
  • Windows事件日志
  • 读取事件日志在C#​​
  • read the windows event log by particular Source
  • Read event log in C#

这篇关于运行程序时,Windows启动(登录前)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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