Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jul 22nd, 2012  |  syntax: None  |  size: 0.88 KB  |  views: 383  |  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. this operation is not supported in the wcf test client because it uses type system.object[]
  2. [ServiceBehavior(InstanceContextMode=InstanceContextMode.Single)]
  3.     class Windows_processes_Service:IWindows_processes_Service
  4.     {
  5.         ArrayList RunningProcesses_Name = new ArrayList();
  6.         public ArrayList GetRunningProcesses()
  7.         {
  8.             Process[] processlist = Process.GetProcesses();
  9.             foreach (Process nme_processes in processlist)
  10.             {
  11.                 RunningProcesses_Name.Add(nme_processes.ProcessName.ToString());
  12.             }
  13.             return RunningProcesses_Name;
  14.         }
  15.     }
  16.        
  17. [ServiceBehavior(InstanceContextMode=InstanceContextMode.Single)]
  18. class Windows_processes_Service:IWindows_processes_Service
  19. {
  20.     public List<string> GetRunningProcesses()
  21.     {
  22.         return Process.GetProcesses().Select(p => p.ProcessName).ToList();
  23.     }
  24. }