Make your app opens just ones when it already open

Make your c# and vb.net app opens just ones when it already open
 This is a simple idea to Cleary,  meaning that the user open the program , he can't open another one in the same time,  the idea depends to md5 hash count of the application,
Then bring all processes running in the machine, and count their own md5 hash , and made the comparison between process hash and  our program hash , and in the case of a match, the program is to make sure first that the process is not its own, if it  not , this means that the program is already open,and it will close it itself 
Let's get started...

If you are C# Developer
Ad this fuction to your project 
Copy all and past to your project 




Then add this code to the form load event






The project needs to
using System.Security.Cryptography;
using System.IO;
using System.Diagnostics;

---------------------------------
Or If your vb.net developer its the same
Steps but with vb.net coding language

 Call those library 
Imqport those library :
Imports System.IO
Imports System.Security.Cryptography

 Add this function :





-------
Then this code in the form load event

 



This it , you done here , hope you get what you need
If this helps,  please join our social media 

Comments