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. Advertisements

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. pberna
    Replies:
    5
    Views:
    3,955
    Scott Allen
    Nov 15, 2004
  2. Reny J Joseph Thuthikattu
    Replies:
    1
    Views:
    835
    =?Utf-8?B?UHJha2FzaC5ORVQ=?=
    Dec 30, 2004
  3. Dr. X
    Replies:
    1
    Views:
    586
    Saravana
    Jul 22, 2003
  4. Replies:
    1
    Views:
    413
    Joe Kaplan \(MVP - ADSI\)
    Jun 14, 2006
  5. pberna
    Replies:
    0
    Views:
    211
    pberna
    Jul 28, 2004
  6. Replies:
    3
    Views:
    564
  7. Noremac

    Pass through Windows Identity to Web Service

    Noremac, Nov 15, 2007, in forum: ASP .Net Web Services
    Replies:
    2
    Views:
    922
    Steven Cheng[MSFT]
    Nov 21, 2007
  8. Leo Violette
    Replies:
    0
    Views:
    1,316
    Leo Violette
    Apr 17, 2009
Loading...