[STAThread] public static void Main() { Process[] localByName = Process.GetProcessesByName("faceme"); Process currentProcess = Process.GetCurrentProcess(); int nProcessID = Process.GetCurrentProcess().Id; var runningProcess = (from process in Process.GetProcesses() where process.Id != currentProcess.Id && process.ProcessName.Equals( currentProcess.ProcessName, StringComparison.Ordinal) select process).FirstOrDefault(); if (runningProcess != null) { runningProcess.Kill(); } MyApp.App app = new MyApp.App(); app.InitializeComponent(); app.Run(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)