Best way to implement singleton in a console application C#?

后端 未结 4 1049
夕颜
夕颜 2020-12-16 18:23

I have a console application that is server based. I only want 1 instance of it running at once for a particular server (this is regardless of the user who might be running

4条回答
  •  情歌与酒
    2020-12-16 19:28

    You should use Mutex class, like explained here: C# .NET Single Instance Application

提交回复
热议问题