Prevent C# app from process kill

后端 未结 9 1633
我寻月下人不归
我寻月下人不归 2020-11-29 11:39

How can I protect my C# app from someone killing its process via taskman or programmatically?

Here is my scenario:

App A is an MFC app developed by another t

9条回答
  •  粉色の甜心
    2020-11-29 11:55

    Short answer: you can't and you shouldn't.

    Long answer: You can try to start a second 'helper' process, that checks every x seconds if your app is still running. If it isn't, it restarts it.

    If you want a process to run for a long time just don't trust users to keep it running, consider windows services. They are designed for this.

提交回复
热议问题