Here is a quick sample on how to list the collection entries of the defaultDocument section file collection.
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Web.Administration;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
ServerManager serverManager = new ServerManager();
Configuration appHostConfig = serverManager.GetApplicationHostConfiguration();
ConfigurationSection defaultDocumentSection = appHostConfig.GetSection("system.webServer/defaultDocument");
foreach (ConfigurationElement element in defaultDocumentSection.GetCollection("files"))
{
Console.WriteLine(element.GetAttribute("value").Value);
}
}
}
}