VB: Unkillable Proccess
If you need help with a project or need to know how to do something specific in VB.NET then please ask your questions in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
2 posts
Page 1 of 1
Hello, I'm trying to make a process killer but I want to make it bulletproof. What I mean about bulletproof is,
I want to make my program unkillable if killed using my own program. Thanks to who'll help.
I want to make my program unkillable if killed using my own program. Thanks to who'll help.
I apologize for my ignorance, but wouldn't this be as simple as comparing the process ID of your program to the ID of the process you want to kill and make sure they're not the same?
VB.NET has a method called Process.GetCurrentProcess() which returns an object corresponding to the process of the current program. If I'm not mistaken, it should then be a simple matter of comparing IDs.
VB.NET has a method called Process.GetCurrentProcess() which returns an object corresponding to the process of the current program. If I'm not mistaken, it should then be a simple matter of comparing IDs.
Code: Select all
Dim myProcess As System.Diagnostics.Process = System.Diagnostics.Process.GetCurrentProcess()
If myProcess.Id <> otherProcess.Id Then
'Kill process
End If
2 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023