GetValues()
‘此方法對於迭代列舉值非常有用’
Enum Animal
Dog = 1
Cat = 2
Frog = 4
End Enum
Dim Animals = [Enum].GetValues(GetType(Animal))
For Each animal in Animals
Console.WriteLine(animal)
Next
列印:
1
2
4
‘此方法對於迭代列舉值非常有用’
Enum Animal
Dog = 1
Cat = 2
Frog = 4
End Enum
Dim Animals = [Enum].GetValues(GetType(Animal))
For Each animal in Animals
Console.WriteLine(animal)
Next
列印:
1
2
4