System.InvalidOperationException at GetServices call

This exception was thrown at the second statement:

System.ServiceProcess.ServiceController[] services;
services = System.ServiceProcess.ServiceController.GetServices ( "DM*****" );

I am wondering if there is anything I can do to get it working. The explanation I read at MSDN help is not encouraging.

Thanks.

[347 byte] By [AlexBB] at [2007-12-24]
# 1

Try to make sure 2 things,

  1. Try to pass a different service name as a parameter like, Client.exe etc.
  2. The code you are running this has administrative previllages?

BTW this looks weird to me too. Seei in GetServices' Intellisence, This Exception will definitely be listed there and Also Description for it that when it is thrown when calling this function.

Cheers ;-)

RizwanSharp at 2007-8-31 > top of Msdn Tech,Visual C#,Visual C# General...