How I can get physical path of site on a disk ?
using (ServerManager serverManager = new ServerManager()) {
var sites = serverManager.Sites;
foreach (Site
To improve a bit what others wrote, remember if you have multiple application pools pr site you get multiple directories.
using (var iisManager = new ServerManager())
{
SiteCollection sites = iisManager.Sites;
foreach (var site in sites)
{
Console.WriteLine(site.Name);
foreach(var app in site.Applications)
{
foreach (var virt in app.VirtualDirectories)
{
Console.WriteLine(site.Name);
}
}
}
}