Hi!
Is there are way to progammatically determine the root directory's local path of the current sharepoint site?
Best Regard
Oliver Hanappi
Hi!
Is there are way to progammatically determine the root directory's local path of the current sharepoint site?
Best Regard
Oliver Hanappi
You can determine the physical local path of the Web Application by querying the IisSettings colelction on your site.
Such as this:
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Administration;
namespace WSStest
{
class Program
{
static void Main(string[] args)
{
using (SPSite site = new SPSite("http://<YOURSITE>"))
{
string localPath = site.WebApplication.IisSettings[SPUrlZone.Default].Path.ToString();
Console.WriteLine("Local path: " + localPath);
}
}
}
}