How to control Windows Service through Web Service

Discussion in 'ASP .Net' started by prowyh, Nov 16, 2007.

  1. prowyh

    prowyh Guest

    Hi, all,

    I am struggling with the problem controlling Windows Service through
    Web Service, such as the following code snippet:

    ServiceController sc = new ServiceController();
    sc.ServiceName = "myService";
    sc.Start();
    sc.WaitForStatus(ServiceControllerStatus.Running);

    This code snippet is wrapped in Web Service. But error! The compaint
    is that can not open the service, refuse access.

    Any idea? How to assign the access rights to this code snippet?

    Thanks!
     
    prowyh, Nov 16, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dr. X
    Replies:
    1
    Views:
    464
    Saravana
    Jul 22, 2003
  2. Replies:
    1
    Views:
    245
    Joe Kaplan \(MVP - ADSI\)
    Jun 14, 2006
  3. pberna
    Replies:
    0
    Views:
    132
    pberna
    Jul 28, 2004
  4. Replies:
    3
    Views:
    381
  5. Noremac

    Pass through Windows Identity to Web Service

    Noremac, Nov 15, 2007, in forum: ASP .Net Web Services
    Replies:
    2
    Views:
    511
    Steven Cheng[MSFT]
    Nov 21, 2007
Loading...

Share This Page