Ejemplo n.º 1
0
        DirectoryEntry CreateVDirNode(string siteName, string vDirName, string schemaClassName)
        {
            if (DoesVirtualDirectoryExist()) return new Iis6Path(ServerName, siteName, vDirName).ToDirectoryEntry();

            var path = new Iis6Path(ServerName, siteName);
            var parent = path.ToDirectoryEntry();
            parent.RefreshCache();
            var child = parent.Children.Add(vDirName.Trim('/'), schemaClassName);
            child.CommitChanges();
            parent.CommitChanges();
            parent.Close();

            return child;
        }
Ejemplo n.º 2
0
        DirectoryEntry CreateVDirNode(string siteName, string vDirName, string schemaClassName)
        {
            if (DoesVirtualDirectoryExist())
            {
                return(new Iis6Path(ServerName, siteName, vDirName).ToDirectoryEntry());
            }

            var path   = new Iis6Path(ServerName, siteName);
            var parent = path.ToDirectoryEntry();

            parent.RefreshCache();
            var child = parent.Children.Add(vDirName.Trim('/'), schemaClassName);

            child.CommitChanges();
            parent.CommitChanges();
            parent.Close();
            return(child);
        }
Ejemplo n.º 3
0
        bool DoesVirtualDirectoryExist()
        {
            var entry = new Iis6Path(ServerName, WebsiteName, VdirPath).ToDirectoryEntry();

            try
            {
                //trigger the *private* entry.Bind() method
                var adsobject = entry.NativeObject;
                return true;
            }
            catch
            {
                return false;
            }
            finally
            {
                entry.Dispose();
            }
        }
Ejemplo n.º 4
0
        bool DoesVirtualDirectoryExist()
        {
            var entry = new Iis6Path(ServerName, WebsiteName, VirtualDirectoryPath).ToDirectoryEntry();

            try
            {
                //trigger the *private* entry.Bind() method
                var adsobject = entry.NativeObject;
                return(true);
            }
            catch
            {
                return(false);
            }
            finally
            {
                entry.Dispose();
            }
        }