Home > Net >  Close the IIS site
Close the IIS site

Time:11-03

Public void StopWebSite ()
{
System. DirectoryServices. DirectoryEntry WebSite=new System. DirectoryServices. DirectoryEntry (" IIS://localhost/w3svc/1 ");
WebSite. Invoke (" Stop ", the new object [] {});
}


This is closed, IIS site code from the Internet search, program startup will close the site to be obtained, uncertain path here is how to change, use the default IIS://localhost/w3svc/1 run will be an error "" the system cannot find the specified path" ", such as my site port is 2020, I changed to IIS://localhost: 2020, the operation will be submitted to the "" unknown error (0 x8000500)", "don't know how to change, also, every brother please give directions,
  •  Tags:  
  • C#
  • Related