SHARE
TWEET

Untitled

a guest Jul 22nd, 2012 589 Never
  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. }
RAW Paste Data
Top