예제 #1
0
        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");
                }
            }
        }
예제 #2
0
 private static void StartWebSite(webSiteType siteType)
 {
     StopStartWebSite(siteType, true);
 }
예제 #3
0
 private static void StopWebSite(webSiteType siteType)
 {
     StopStartWebSite(siteType, false);
 }