G
Guest
Hi,
If I have this enumeration:
public enum SampleEnum
{
First=1,
Second=2,
Third=3
}
and I have a variable of type SampleEnum, how do I get its corresponding
number?
I tried this:
SampleEnum a=SampleEnum.Second;
int i=a.ConvertToInt16(a); // i=2
and it works, but I am not sure if it is the right way to do it.
Thanks
If I have this enumeration:
public enum SampleEnum
{
First=1,
Second=2,
Third=3
}
and I have a variable of type SampleEnum, how do I get its corresponding
number?
I tried this:
SampleEnum a=SampleEnum.Second;
int i=a.ConvertToInt16(a); // i=2
and it works, but I am not sure if it is the right way to do it.
Thanks