I am confused about is there any way to access static class property values using the static class name defined inside a string variable Example :
I have a static class like below
public static class CoreConstants
{
public const string HostAddress= "someaddress";
}
And I have a string variable like
private string staticClassName="CoreConstants";
So is there any way to get the value of the HostAddress field using the string?
I know we can use Activator.CreateInstance() method if the class is a normal class , and using the instance we can get the values. But what about if the class is a static class ?
My real situation is like I have few static classes which holds constants for different language. Each request will pass a language indicator string, so using the string I need to get the exact message from the particular static class .