Sep 20, 2006 #1 murrayja Programmer May 6, 2000 90 US I am converting an app from VB6 to C#. Is there an equivalent "App.Previnstance" in C# to detect if the app is already running?
I am converting an app from VB6 to C#. Is there an equivalent "App.Previnstance" in C# to detect if the app is already running?
Sep 20, 2006 1 #2 codeing Programmer Sep 4, 2006 4 IN may be you could find some help by this link: - http://www.dotnet247.com/247reference/msgs/57/286221.aspx Upvote 0 Downvote
may be you could find some help by this link: - http://www.dotnet247.com/247reference/msgs/57/286221.aspx
Sep 20, 2006 #3 garygruber Programmer Jan 11, 2006 7 US public bool IsProcessRunning(string ProcName) { bool IsRunning = false; Process[] processes; processes = System.Diagnostics.Process.GetProcesses(); foreach (System.Diagnostics.Process instance in processes) { if (instance.ProcessName.ToUpper()==ProcName.ToUpper()) { IsRunning = true; break; } } return IsRunning; } Upvote 0 Downvote
public bool IsProcessRunning(string ProcName) { bool IsRunning = false; Process[] processes; processes = System.Diagnostics.Process.GetProcesses(); foreach (System.Diagnostics.Process instance in processes) { if (instance.ProcessName.ToUpper()==ProcName.ToUpper()) { IsRunning = true; break; } } return IsRunning; }