How to start/stop IIS service

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I used the following code to manage IIS service

Dim iis As New System.ServiceProcess.ServiceController("IIS Admin Service")
If iis.Status() = ServiceProcess.ServiceControllerStatus.Stopped Then
iis.Start()
End If

but IIS couldn't start. Did I do the correct thing?
 
System.Diagnostics.Process.Start("C:\WINDOWS\System32\inetsrv\inetinfo.exe")
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top