I wanted to make a safe exit for my console application that will be running on linux using mono but I can't find a solution to detect wether a signal was sent to it or the user pressed ctrl+c.
On windows there is the kernel function SetConsoleCtrlHandler which does the job but that doesnt work on mono.
How do I get a closing event on my console application to safe exit it ?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…