View Full Version : Hello . plz How can I prevent the user to run the program
yasmin2009
04-17-2008, 04:02 PM
Hello . plz How can I prevent the user to run the program I made more one time at the same time ... I mean he running the program and if he tried to run it again with the same program is running he will see message says the program is running you can't run the program again .
Try: http://www.indigorose.com/forums/showthread.php?t=20421&highlight=instances
That should get you started.
Sue
yasmin2009
04-17-2008, 04:21 PM
thank you very much sue
ShadowUK
04-17-2008, 04:25 PM
If all fails read the manual.
instances_of_file = 0;
file_to_check_for = "autorun.exe"; --have all lowercase
processes = System.EnumerateProcesses();
for j, file_path in processes do
file = String.SplitPath(file_path);
if (String.Lower(file.Filename..file.Extension)) == file_to_check_for then
Dialog.Message("", "There are more than one instances of "..file_to_check_for.."!");
System.TerminateProcess(j);
end
end
yasmin2009
04-19-2008, 04:20 PM
thank you :)
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.