
本文共 1919 字,大约阅读时间需要 6 分钟。
���������C#���������Enum.Parse���������������
������������������������������������������������������������������Enum������������������C#���������Enum.Parse������������������������������������������������������������������������������������������������������������������������
���������������������������������������������
public enum Color { RED = 1, GREEN = 2, BLUE = 3}
���������������������������������������������������
static void Main(string[] args) { string colorString = "BLUE"; Color����(setq: Color color = (Color)Enum.Parse(typeof(Color), colorString); Console.WriteLine(color);}
������Enum.Parse���������������������������������
���������������������������Enum.Parse������������������������:
������������������������������ Enum.Parse������������������������������������������������������������������������������������������������
��������������������� ������������������EnumParseException������������������������������������������������������
������������������������
������������������������������������������������ implicitly������
static void Main(string[] args) { string colorString = "BLUE"; Color color = Enum.Parse(typeof(Color), colorString); Console.WriteLine(color);}
Enum.Parse
���������������
Enum.Parse
��������������������������������������������������������������������������������������������������������������� nombres���������������������������������������������������������������
���������������������������
��������������������������������������������������������������������������������������������������������� ������������HashCode������������������������������������������������������������������
������������������������
���������Enum.Parse������������������������������������opposite PascalCase���������������������������������������������
���������������������������������������������������������������������������������������������
发表评论
最新留言
关于作者
