Joke Collection Website - Talk about mood - In Yi Language, if you want to open multiple control software, what method should you use?

In Yi Language, if you want to open multiple control software, what method should you use?

Yi Language... I don’t understand. But the method should be universal.

The first is to traverse the process table and count the number of its own processes. This is the most orthodox, convenient and safest.

Second, use network broadcast to count. When the program starts, it sends a broadcast signal, and the process that receives the signal replies.

The third option is to find a secret place in the system to set up a semaphore.

Focus on the third type. The key lies in secrecy. Possible methods are probably:

A. Write a text file in a fixed location of the system. There is a count in it, which increases by one when starting and decreases by one when exiting.

B. Each instance creates a temporary file in a fixed location and deletes its own when exiting.

C. Add a count item at the specified location in the registry.

D. Bind a certain port. For example: starting from 32450, looking for unbound ports...

All of the above methods classified into the third category have flaws that are unreliable and easy to crack.

And it is not necessarily less difficult to implement than the first two.

Choose the one that suits you best.