系统服务在系统关闭之前发送邮件 [英] System Service to send mail before system shutdown

查看:73
本文介绍了系统服务在系统关闭之前发送邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





i已经创建了可以通过gmail发送邮件的服务。



i want使用同样的服务来监控我的系统关机或注销......



如果上述任何一项通知,那么它将发送邮件。



所以如何在服务中获取系统关闭通知。

Hi,

i have created services which is able to send mail via gmail.

i want use this same service who monitor my system for shutdown or log off ...

if any of above notify then it will send mail.

so how to get system shutdown notification in services.

推荐答案

你可以附加一个事件处理程序 SystemEvents.SessionEnding [ ^ ]事件。这是一个示例 [ ^ ]。
You can attach an event handler to the SystemEvents.SessionEnding[^] event. Here is an example[^].


这篇关于系统服务在系统关闭之前发送邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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