Enumeration Question

  • Thread starter Thread starter Yosh
  • Start date Start date
Y

Yosh

Hi!

I am curious if it's possible to get the actual string name representation
of an Enum type. I want the actual Enum name that represents the number and
place it in a string.

public enum SecurityTypeEnum

{

AppConfig = 1,

NTSecurity = 2

}
 
Hi!

I am curious if it's possible to get the actual string name representation
of an Enum type. I want the actual Enum name that represents the number and
place it in a string.

public enum SecurityTypeEnum

{

AppConfig = 1,

NTSecurity = 2

}

SecurityTypeEnum.AppConfig.ToString() = "AppConfig"
SecurityTypeEnum.NTSecurity.ToString() = "NTSecurity"

Is that what you mean? Just call ToString on it and it will give you the
string name.
 
Back
Top