I am using ResourceManager
in Sytem.Resources
class of C#.ResourceManager has a protected constructor, so we cant create the instance directly. I want to use the GetObject function to get the object of WinNT.
I want to do the following :
IADsOpenDSObject user= (IADsOpenDSObject)Utils.GetObject("WinNT:");
Details about IADsOpenDSObject is available in the following link.
I tried doing the following :
class ResourceManagerSub : ResourceManager
{
public ResourceManagerSub()
{
}
}
public class Program
{
static void Main(string[] args)
{
ResourceManagerSub Utils = new ResourceManagerSub();
IADsOpenDSObject user = (IADsOpenDSObject)Utils.GetObject("WinNT:");
user.OpenDSObject("WinNT://machinename", Username, Password, (int)ADS_AUTHENTICATION_ENUM.ADS_SECURE_AUTHENTICATION);
}
}
But I am getting exception : Object reference not set to an instance of an object.
So how is it possible to instantiate ResourceManager
?