Windows服务运行时,我们可以捕获任何异常或消息吗? [英] can we catch any exception or message while the windows service is running?

查看:61
本文介绍了Windows服务运行时,我们可以捕获任何异常或消息吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的朋友,


Windows服务运行时,我们可以捕获任何异常或消息吗?

谢谢与问候,
ramu

Dear friends,


can we catch any exception or message while the windows service is running?

Thanks&Regards,
ramu

推荐答案

为什么不呢? Windows服务只是运行代码的环境,您仍然可以使用其中的所有语言功能.一个简单的尝试,catch块应该起作用.

除了我所说的,我不只是尝试尝试,catch块,我还想知道为什么抛出异常.我应该在代码中处理吗?
Why not? Windows service is just an environment to run your code, you can still use all language features in it. A simple try, catch block should work.

Apart from what I said, instead of just introducing a try, catch block I would rather look why an exception is thrown. Is it something which I should be handling in my code?


这篇关于Windows服务运行时,我们可以捕获任何异常或消息吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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