Use the following Chunk 2 get the SSP URL. This uses reflection mechanism.
private string getSSPURL()
{
string uri = string.Empty;
ServerContext sc = ServerContext.Default;
object ssp = sc.GetType().GetProperty("SharedResourceProvider",BindingFlags.Instance | BindingFlags.NonPublic).GetValue(sc, null);
Guid sspGuid = (Guid)ssp.GetType().GetProperty("AdministrationSiteId").GetValue(ssp, null);
using (SPSite sspSite = new SPSite(sspGuid))
{
uri = sspSite.WebApplication.GetResponseUri(SPUrlZone.Default).AbsoluteUri + "ssp/admin";
}
return uri;
}
No comments:
Post a Comment