how can I make a Windows service beep?

前端 未结 5 1722
栀梦
栀梦 2020-12-06 14:23

I\'ve got a service that acts as a watchdog for several apps/servers. There are no user sessions on this machine. I\'d like the watchdog to be capable of beeping on the

5条回答
  •  独厮守ぢ
    2020-12-06 15:03

    I'd recommend creating a simple client application that polls that server to query for any problems and returns a set of status messages. Then an appropriate UI would be raised (e.g. balloon on the tray), an email sent, etc. containing any warning or failure messages.

    This way you also know that the watchdog itself is running and has network connectivity - if the watchdog dies and/or machine locks up you wouldn't otherwise know.

    It also avoids being thrown out of a window when the machine starts beeping continuously just after you go to lunch. [+1 to @mikej] :-)

    The poll period should be around half (see Nyquist sampling rate) your minimum required response time.

提交回复
热议问题