我如何解析一个字符串在VB.NET枚举值?
示例我有这个枚举:
Public Enum Gender NotDefined Male Female End Enum
如何将字符串“男”转换为性别枚举的男性值?
Dim val = DirectCast([Enum].Parse(GetType(Gender),"Male"),Gender)
示例我有这个枚举:
Public Enum Gender NotDefined Male Female End Enum
如何将字符串“男”转换为性别枚举的男性值?
Dim val = DirectCast([Enum].Parse(GetType(Gender),"Male"),Gender)