I am using vb.net 2005 and I use this in a button_click event that will change the status of the service (either start or stop). It first checks to see if the service is installed.
hth
K
Dim ServiceController As New System.ServiceProcess.Serv
dim service = "IISadmin" 'use the service name not the display name.
If isServiceInstalled(service
If ServiceController.Status = ServiceProcess.ServiceCont
If ServiceController.CanStop Then
ServiceController.Stop()
ServiceController.WaitForS
End If
ElseIf ServiceController.Status = ServiceProcess.ServiceCont
ServiceController.Start()
ServiceController.WaitForS
End If
End If
Main Topics
Browse All Topics





by: marchianoPosted on 2005-12-01 at 17:42:19ID: 15401906
to restart your IIS, execute this command in DOS:
iisreset /stop
then
iisreset /start
OR go to administrative tools in your control panel
you can restart MySQL only if you are an administrator
otherwise you can't do that..