【发布时间】:2015-08-26 13:22:28
【问题描述】:
我需要使用 SSH.NET 库执行 2 个 SSH 命令。第一个命令将在 Windows 启动时执行,第二个命令将在 Windows 关闭时执行。我怎样才能做到这一点?
【问题讨论】:
-
启动很容易,您只需将应用程序设置为在启动时运行。关机涉及监控
SystemEvents.SessionEnding事件,见msdn.microsoft.com/en-us/library/… -
谢谢,我去看看
标签: c# windows startup detect shutdown