How to start Windows services from C# code

Discussion in 'ASP .Net' started by nivedita, Jul 31, 2008.

  1. nivedita

    nivedita Guest

    I got below function from http://techinterviewquestion.blogspot.com/
    blog. it is working fine. i used

    public void StartService(string ServiceName)
    {
    ServiceController sc = new ServiceController(ServiceName);
    if (sc != null && sc.Status == ServiceControllerStatus.Stopped)
    {

    sc.Start();
    sc.WaitForStatus(ServiceControllerStatus.Running);

    }
    }
     
    nivedita, Jul 31, 2008
    #1
    1. Advertising

  2. re:
    !> do you have an issue with ASP.NET...?

    Nah. He's spamming this newsgroup.




    Juan T. Llibre, asp.net MVP
    asp.net faq : http://asp.net.do/faq/
    foros de asp.net, en espaƱol : http://asp.net.do/foros/
    ======================================
    "Mark Rae [MVP]" <> wrote in message news:...
    > "nivedita" <> wrote in message
    > news:...
    >
    >> I got below function from http://techinterviewquestion.blogspot.com/
    >> blog. it is working fine. i used

    >
    > This is the ASP.NET newsgroup - do you have an issue with ASP.NET...?
    >
    >
    > --
    > Mark Rae
    > ASP.NET MVP
    > http://www.markrae.net
     
    Juan T. Llibre, Jul 31, 2008
    #2
    1. Advertising

  3. nivedita

    Munna Guest

    Munna, Jul 31, 2008
    #3
  4. nivedita

    Munna Guest

    Yep ... she is spamming! .. checked her other posts... totally
    spamming!
     
    Munna, Jul 31, 2008
    #4
    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. SenthilVel
    Replies:
    5
    Views:
    11,323
    Neuron Upheaval
    Jan 16, 2009
  2. Nick
    Replies:
    1
    Views:
    6,226
    Alvin Bruney - ASP.NET MVP
    Sep 12, 2005
  3. Anup
    Replies:
    1
    Views:
    2,823
    Mark Rae
    May 9, 2006
  4. imlakhani

    Web Services Restful Services

    imlakhani, Dec 16, 2009, in forum: Java
    Replies:
    1
    Views:
    441
    Jeffrey H. Coffield
    Dec 16, 2009
  5. Software Engineer
    Replies:
    0
    Views:
    357
    Software Engineer
    Jun 10, 2011
Loading...

Share This Page