internal IISWebServer() { iID = -1; sServerName = ""; sRootPath = ""; vdcDirectories = new IISWebVirtualDirectoryCollection(); wdcDirectories = new IISWebDirectoryCollection(); }
internal IISWebDirectory() { _sName = ""; _sPath = ""; _isApplication = false; _iWebServerID = -1; wdc = new IISWebDirectoryCollection(); }
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(); } } }
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(); } } }