Example #1
0
        public override void SetASPDotNetVersion(AspDotNetVersion version)
        {
            DirectoryEntry virDir = IISWMIHelper.GetIIsWebVirtualDir(SiteId);

            ScriptMapper.SetASPNetVersion(virDir, version);
            virDir.CommitChanges();
        }
Example #2
0
        private void SetVirtualDirProperty(String propertyName, object propertyValue)
        {
            DirectoryEntry virDir = IISWMIHelper.GetIIsWebVirtualDir(SiteId);

            virDir.Properties[propertyName].Value = propertyValue;
            virDir.CommitChanges();
        }
Example #3
0
        public static IISWMISite CreateNewSite(String serverComment, String serverBindings, String filePath)
        {
            Directory.CreateDirectory(filePath);
            IISWMISite retVal = new IISWMISite();

            //Do not put any bindings in... we will do that after the site is create
            retVal.SiteId = Convert.ToString(IISWMIHelper.GetIIsWebService().Invoke("CreateNewSite", serverComment, new object[0], filePath));
            retVal.SetBindings(serverBindings);
            return(retVal);
        }
Example #4
0
 public override void Start()
 {
     try
     {
         IISWMIHelper.GetIIsWebServer(SiteId).Invoke("Start", null);
     }
     catch (Exception exp)
     {
         throw new Exception(String.Format("Inner error: {0} Outer error: {1}", exp.InnerException.Message, exp.Message));
     }
 }
Example #5
0
        public static bool DeleteSite(IISIdentifier siteIdentifier)
        {
            String id = "";

            //need to be sure that the site exists or else it can throw an error
            if (IISWMIHelper.TryGetSiteID(siteIdentifier, ref id))
            {
                DirectoryEntry webServer = IISWMIHelper.GetIIsWebServer(id);
                webServer.Invoke("Stop", null);
                webServer.DeleteTree();
                return(true);
            }
            return(false);
        }
Example #6
0
        //Return null if the site is not to be found
        public static IISWMISite FindSite(IISIdentifier Identifier)
        {
            String id = "";

            //need to be sure that the site exists or else it can throw an error
            if (IISWMIHelper.TryGetSiteID(Identifier, ref id))
            {
                return(new IISWMISite()
                {
                    SiteId = id
                });
            }
            return(null);
        }
Example #7
0
        private T GetVirtualDirPropertyDef <T>(String propertyName, T DefaultValue)
        {
            PropertyValueCollection pc = IISWMIHelper.GetIIsWebVirtualDir(SiteId).Properties["propertyName"];

            return((pc != null) ? (T)Convert.ChangeType(pc.Value, typeof(T)) : DefaultValue);
        }