private void LoadIISInformation()
{
Dictionary
foreach (DirectoryEntry dir in VirtualDirectories)
{
entries[dir.Name] = dir;
this.listWebsitesComboBox.Items.Add(dir.Name);
}
this.listWebsitesComboBox.Tag = entries;
}
public DirectoryEntries VirtualDirectories
{
get
{
try
{
return (new DirectoryEntry("IIS://localhost/W3SVC/1")).Children.Find("Root", "IIsWebVirtualDir").Children;
}
catch (Exception e)
{
throw new Exception("Error while retrieving virtual directories.", e);
}
}
}
Probably you are interested about physical path of the virtual directories as I was. It is pretty simple, there is a property named "path" which will provide the physical path of your virtual directory.
notun jinis shikhlam. thanks :)
ReplyDelete