Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Component Services / November 2003

Tip: Looking for answers? Try searching our database.

Start / Stop Service from WEB Page

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Laurent Lequenne - 04 Nov 2003 10:24 GMT
Hello there,

I'm trying to use the ServiceController object to Start / Stop a service
from a web page. I have a Access denied message error. This seems to be
normal :-)  But now I try to get the rid of it, and I have no Idea how I can
do it.

Here is the piece of code doing that stuff

System.ServiceProcess.ServiceController svc =
new System.ServiceProcess.ServiceController("DigiPoint Invoicing Service");

if (svc.Status == System.ServiceProcess.ServiceControllerStatus.Running )
{
   svc.Stop();
   btnService.Text = "Start Calculation Service";
}
else
{
   svc.Start();
   btnService.Text = "Stop Calculation Service";
}

If you have some links, or little sample it will be great.

Many thanks

Laurent
Girish Bharadwaj - 06 Nov 2003 16:19 GMT
> Hello there,
>
[quoted text clipped - 24 lines]
>
> Laurent

If this web page is in ASP.NET, then you either need to provide the user
under which the web application is running enough privileges to call
ServiceController class. You need to have specific rights (I dont
remember which ones) which are not available to the default user under
which that web application runs.

Signature

Girish Bharadwaj

Laurent Lequenne - 13 Nov 2003 12:51 GMT
> If this web page is in ASP.NET, then you either need to provide the user
> under which the web application is running enough privileges to call
> ServiceController class. You need to have specific rights (I dont
> remember which ones) which are not available to the default user under
> which that web application runs.

Hey Girish, thanks for your reply. But I already realized that all. Now my
problem is just to know how to solve it :-)

Laurnet

> > Hello there,
> >
[quoted text clipped - 24 lines]
> >
> > Laurent

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.