static void Main(string[] args) { if (Process.GetProcessesByName(Process.GetCurrentProcess().ProcessName).Length > 1) { return; } EXEC_MODE md = EXEC_MODE.HELP; int pid = 0; AnalysisCmd(args, out md, out pid); if ((md == EXEC_MODE.HELP) || (md == EXEC_MODE.NONE)) { Usage(); return; } ProcessAE[] lst = NFsAE.ProcessAEList(); if (lst.Length > 0) { if (pid > 0) { Process pp = null; foreach (ProcessAE p in lst) { if (p.ProcessID == pid) { pp = p.Proc; break; } } if (pp != null) { pp.WaitForInputIdle(); ShowWindow(pp.MainWindowHandle, (int)md); SetForegroundWindow(pp.MainWindowHandle); return; } } foreach (ProcessAE p in lst) { p.Proc.WaitForInputIdle(); ShowWindow(p.Proc.MainWindowHandle, (int)md); SetForegroundWindow(p.Proc.MainWindowHandle); } } else { Usage(); } }
static void Main(string[] args) { string ret = ""; ProcessAE[] lst = NFsAE.ProcessAEList(); foreach (ProcessAE aes in lst) { if (ret != "") { ret += ","; } ret += aes.ToAEJson; } Console.WriteLine("([" + ret + "])"); }