private static void StopStartWebSite(webSiteType siteType, bool start) { string entryName = "IIS://LocalHost/W3SVC/1"; if (siteType == webSiteType.test) { entryName = "IIS://LocalHost/W3SVC/2"; } using (var dirEntry = new DirectoryEntry(entryName)) { if (start) { dirEntry.Invoke("start"); } else { dirEntry.Invoke("stop"); } } }
private static void StartWebSite(webSiteType siteType) { StopStartWebSite(siteType, true); }
private static void StopWebSite(webSiteType siteType) { StopStartWebSite(siteType, false); }