Esempio n. 1
0
        private static void AddWebDirectories(DirectoryEntry o, string sParentPath, IISWebDirectoryCollection wdcParent,
                                              int iServerID, string sPhisicalPath)
        {
            IEnumerator iEnumerator = o.Children.GetEnumerator();

            try
            {
                while (iEnumerator.MoveNext())
                {
                    var directoryEntry = (DirectoryEntry)iEnumerator.Current;
                    if (directoryEntry.SchemaClassName.ToUpper() == "IIsWebDirectory".ToUpper() &&
                        Directory.Exists(String.Concat(sPhisicalPath, "\\", directoryEntry.Name)))
                    {
                        var iISWebDirectory = new IISWebDirectory
                        {
                            _sPath = String.Concat(sParentPath, "/", directoryEntry.Name),
                            _sName = directoryEntry.Name
                        };
                        if (directoryEntry.Properties["AppRoot"][0].ToString().ToUpper() ==
                            String.Concat("/LM/W3SVC/", iServerID, "/ROOT") ||
                            directoryEntry.Properties["AppRoot"][0].ToString().ToUpper() ==
                            String.Concat(new object[] { "/LM/W3SVC/", iServerID, "/ROOT", sParentPath.ToUpper() }))
                        {
                            iISWebDirectory._isApplication = false;
                        }
                        else
                        {
                            iISWebDirectory._isApplication = true;
                        }
                        iISWebDirectory._iWebServerID = iServerID;
                        AddWebDirectories(new DirectoryEntry(String.Concat(o.Path, "/", directoryEntry.Name)),
                                          iISWebDirectory._sPath, iISWebDirectory.NestedWebDirectories, iServerID,
                                          String.Concat(sPhisicalPath, "\\", directoryEntry.Name));
                        wdcParent.Add(iISWebDirectory);
                    }
                }
            }
            finally
            {
                var iDisposable = iEnumerator as IDisposable;
                if (iDisposable != null)
                {
                    iDisposable.Dispose();
                }
            }
        }
Esempio n. 2
0
 private static void AddWebDirectories(DirectoryEntry o, string sParentPath, IISWebDirectoryCollection wdcParent,
                                int iServerID, string sPhisicalPath)
 {
     IEnumerator iEnumerator = o.Children.GetEnumerator();
     try
     {
         while (iEnumerator.MoveNext())
         {
             var directoryEntry = (DirectoryEntry) iEnumerator.Current;
             if (directoryEntry.SchemaClassName.ToUpper() == "IIsWebDirectory".ToUpper() &&
                 Directory.Exists(String.Concat(sPhisicalPath, "\\", directoryEntry.Name)))
             {
                 var iISWebDirectory = new IISWebDirectory
                                           {
                                               _sPath = String.Concat(sParentPath, "/", directoryEntry.Name),
                                               _sName = directoryEntry.Name
                                           };
                 if (directoryEntry.Properties["AppRoot"][0].ToString().ToUpper() ==
                     String.Concat("/LM/W3SVC/", iServerID, "/ROOT") ||
                     directoryEntry.Properties["AppRoot"][0].ToString().ToUpper() ==
                     String.Concat(new object[] {"/LM/W3SVC/", iServerID, "/ROOT", sParentPath.ToUpper()}))
                 {
                     iISWebDirectory._isApplication = false;
                 }
                 else
                 {
                     iISWebDirectory._isApplication = true;
                 }
                 iISWebDirectory._iWebServerID = iServerID;
                 AddWebDirectories(new DirectoryEntry(String.Concat(o.Path, "/", directoryEntry.Name)),
                                   iISWebDirectory._sPath, iISWebDirectory.NestedWebDirectories, iServerID,
                                   String.Concat(sPhisicalPath, "\\", directoryEntry.Name));
                 wdcParent.Add(iISWebDirectory);
             }
         }
     }
     finally
     {
         var iDisposable = iEnumerator as IDisposable;
         if (iDisposable != null)
         {
             iDisposable.Dispose();
         }
     }
 }
Esempio n. 3
0
 public void Remove(IISWebDirectory value)
 {
     List.Remove(value);
 }
Esempio n. 4
0
 public void Insert(int index, IISWebDirectory value)
 {
     List.Insert(index, value);
 }
Esempio n. 5
0
 public int Add(IISWebDirectory value)
 {
     return(List.Add(value));
 }
 public void Remove(IISWebDirectory value)
 {
     List.Remove(value);
 }
 public void Insert(int index, IISWebDirectory value)
 {
     List.Insert(index, value);
 }
 public int Add(IISWebDirectory value)
 {
     return List.Add(value);
 }