Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version
Go to top

Programmatically Manage IIS

, 27 Nov 2008
Base library for programmatically managing IIS through C# and Directory Services.
IISManager.zip
IISManager
DirectoryManager
Base
bin
Debug
Orama.Telamon.Framework.General.DirectoryManager.dll
Orama.Telamon.Framework.General.DirectoryManager.pdb
Release
Orama.Telamon.Framework.General.DirectoryManager.dll
Orama.Telamon.Framework.General.DirectoryManager.pdb
Common
DirectoryManager.csproj.vspscc
IIS
obj
Debug
Orama.Telamon.Framework.General.DirectoryManager.dll
Orama.Telamon.Framework.General.DirectoryManager.pdb
Refactor
Orama.Telamon.Framework.General.DirectoryManager.dll
TempPE
Release
Orama.Telamon.Framework.General.DirectoryManager.dll
Orama.Telamon.Framework.General.DirectoryManager.pdb
TempPE
Properties
IISTreeView
bin
Debug
Sarafian.IISTreeView.vshost.exe
Properties
Settings.settings
TreeNodes
DataSets
DsProperties.xsc
DsProperties.xss
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using Sarafian.Framework.General.DirectoryManager.Base;
using Sarafian.IISTreeView.TreeNodes.DataSets;
using Sarafian.Framework.General.DirectoryManager.Common;
using System.Data;
using System.DirectoryServices;

namespace Sarafian.IISTreeView.TreeNodes
{
    public abstract class BaseNode : TreeNode
    {
        public BaseNode(BaseEntry entry)
            : base(entry.ToString())
        {
            Entry = entry;
            base.Text = entry.Name;
        }
        public BaseEntry Entry { get; private set; }

        public DataView Properties
        {
            get
            {
                DsProperties dsProperties = new DsProperties();
                foreach (PropertyValue pv in Entry.Properties.Values)
                {
                    string value = null;
                    if (pv.IsString)
                    {
                        value = pv.StringValue;
                    }
                    if (pv.IsMultiValue)
                    {
                        value="";
                        object[] values=(object[])pv.Value;
                        for (int i = 0; i < values.Length; i++)
			            {
                            value += String.Format("[{0}]={1}|", i.ToString(), values[i].ToString());
			            }
                    }

                    dsProperties.Properties.AddPropertiesRow(pv.PropertyName, value, pv.IsString, pv.IsMultiValue);
                }
                DataView dv = dsProperties.Properties.DefaultView;
                dv.Sort = "PropertyName";
                return dv;
            }


        }

        protected void AddChildrenNodes()
        {
            foreach (DirectoryEntry de in Entry.Children)
            {
                base.Nodes.Add(new DirectoryEntryNode(de));

            }
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

aSarafian
Team Leader ALGOSYSTEMS
Greece Greece
I live in Athens Greece and currently I am working with Business scale application with .NET latest technologies
 
I've been developing applications for personal and friends usage with C++ using majorly Borland's various IDEs since 1994.
In 2002 I began working for an R&D institute where I was introduced to C# which I worships ever since.
 
I love core application development and I would like to publish more articles here and on my blog, but there is not enough time to do so.
 
I usualy "waste" my spare time watching sitcoms, preferable SCI-FI.
I would like to play chess but I can't find any real world players to hang out with.

| Advertise | Privacy | Mobile
Web03 | 2.8.140926.1 | Last Updated 27 Nov 2008
Article Copyright 2008 by aSarafian
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid