daily pastebin goal
21%
SHARE
TWEET

Untitled

a guest Jan 21st, 2019 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. static bool ProcessCompareInternalName(Process p,string match)
  2. {
  3.     try
  4.     {
  5.         string internalname = p.MainModule.FileVersionInfo.InternalName;
  6.         if (internalname.ToLower() == match.ToLower()) return true;                
  7.         else  return false;
  8.     }
  9.     catch (System.ComponentModel.Win32Exception)
  10.     {
  11.         return false;
  12.     }
  13. }
  14.  
  15. static void Main(string[] args)
  16. {            
  17.     var allproc = Process.GetProcesses();
  18.  
  19.     foreach (Process p in allproc)
  20.     {
  21.         if (ProcessCompareInternalName(p, "program.exe"))
  22.         {
  23.             p.Kill();
  24.         }
  25.     }
  26.  
  27. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top