1. Enum Value
public enum eRangeI { AUTO, OFF, R1uA, R10uA, R100uA, R1mA, R10mA, R100mA, R1A }
static void Main(string[] args)
{
foreach (var item in Enum.GetValues(typeof(eRangeI)))
{
Console.WriteLine($"{item}");
}
Console.Read();
}
2.Enum index
public enum eRangeI { AUTO, OFF, R1uA, R10uA, R100uA, R1mA, R10mA, R100mA, R1A }
static void Main(string[] args)
{
foreach (var item in Enum.GetValues(typeof(eRangeI)))
{
int value = (int)item;
Console.WriteLine($"{value}");
}
Console.Read();
}
댓글 없음:
댓글 쓰기