Home>

When using c#to control the start and stop of the IIS service,Tip:Unable to open iisadmin service on computer "."

When using c#to control the start and stop of the IIS service,Prompt:[Cannot open iisadmin service on computer "."]

This situation occurs in systems with uac, such as Vista, Win7, and Win2008. The reason is that the C#program does not have permission to execute and control the IIS service.

Debugging error prompt:

Execution program error prompt:

For the problem of not having permissions,Usually you can run the program as an administrator using the right button,Or turn uac off, but for us who write programs,Would think of this experience as a nightmare,You must find a way to get permissions.

There are methods,In vs2008 c#you can use a manifest to make the program run as administrator,For details, please click here:C#make program run as administrator via manifest.

c
  • Previous Introduction to object conversion functions toString () and valueOf () in JavaScript
  • Next Variable definition and storage in JavaScript