Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Set maximum forms can be opened (the exe file can be opened 4 times only)

How can I set Maximum forms (exe file) can be opened

(I want to set the exe file can be opened 4 times Only!)

MessageBox("You have already opened This exe file 4 times";

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

you can use this one:

Dim instanceCount As Integer = Process.GetProcessesByName("yourexename").Count()
If instanceCount > 4 then
    MessageBox("You have already opened This exe file 4 times")
    Environment.Exit(0)
End If
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading