标签:name other running color exe mod processes oca []
public static Process RunningInstance() { Process current = Process.GetCurrentProcess(); Process[] processes = Process.GetProcessesByName(current.ProcessName); //查找相同名称的进程 foreach (Process process in processes) { //忽略当前进程 if (process.Id != current.Id) { //确认相同进程的程序运行位置是否一样. if (Assembly.GetExecutingAssembly().Location.Replace("/", "\\") == current.MainModule.FileName) { //Return the other process instance. return process; } } } //No other instance was found, return null. return null; }
标签:name other running color exe mod processes oca []
原文地址:https://www.cnblogs.com/lee24789229/p/9328256.html