Reading the map host header setting
At some point Stefan hinted, that it would be possible to read this setting
and that the code for it, was available in the SCA. Now I've taken this code
and transformed it into .NET using COM interop. Code looks like this:
public bool HostHeaderMappingEnabled
{
get
{
NRSCAPIClass scapi = new NRSCAPIClass();
scapi.Initialize();
// This line throws an exception when not administrator
NRGlobalSettings globalSettings = scapi.get_GlobalSettings(0);
return globalSettings.General.HostNameToChannelMappingEna bled;
}
}
This works fine.... as long as I am logged in as a local administrator. When
I'm not logged in as this, an exception is thrown telling me I need to be. I
was just wondering if anybody else has found a way to do this without
impersonating an administrator, which I'd say is a little over the top for
reading a setting?
TIA
Martin Gildenpfennig
|