![]() Loop through the running processes in with the same name Process processes = Process.GetProcessesByName (current.ProcessName) ![]() ![]() Process current = Process.GetCurrentProcess() Which will kill the currently loading process instantly. OR if ((System.IO.Path.GetFileNameWithoutExtension(().Location)).Count() > 1) ().Kill() This works for any application (any name) and will become true if there is another instance running of the same application.Įdit: To fix your needs you can use either of these: if ((System.IO.Path.GetFileNameWithoutExtension(().Location)).Count() > 1) return įrom your Main method to quit the method. var exists = (System.IO.Path.GetFileNameWithoutExtension(().Location)).Count() > 1
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |