Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 14th, 2012  |  syntax: None  |  size: 0.30 KB  |  hits: 15  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Show all processes in an AnyCPU application
  2. System.Diagnostics.Process[] running = System.Diagnostics.Process.GetProcesses();
  3. for (int i = 0; i < running.Length; i++){
  4.     try{
  5.         Console.WriteLine(running[i].MainModule.FileName);
  6.     }
  7.     catch (Exception ex){}
  8. }
  9.        
  10. running[i].MainModule.FileName