积极答复者
这两句语句是什么含义?请老师帮忙解释一下,谢谢!

问题
答案
-
Enum.GetNames
这句话的意思是获取枚举中所有的项
https://docs.microsoft.com/zh-cn/dotnet/api/system.enum.getnames?view=netframework-4.8
即获取Handshake这个枚举中所有的项
1. 编译枚举Handshake中所有的项,并输出每个项的名称
2. Enum.Parse 是将指定字符串转换位枚举类型,即将handshake这个字符串转换为枚举类型Handshake
https://docs.microsoft.com/en-us/dotnet/api/system.enum.parse?view=netframework-4.8#System_Enum_Parse_System_Type_System_String_System_Boolean_
ericzhou
- 已标记为答案 工控自动化 2019年8月9日 4:01
-
Hi,
根据Enum.GetNames(Type) Method的文档可以知道该方法的参数是一个“Type”类型。而typeof 运算符的作用就是用于获取某个类型的 System.Type 实例。
Regards,
Kyle
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.- 已编辑 Kyle Wang - MSFTMicrosoft contingent staff, Moderator 2019年8月9日 1:33
- 已标记为答案 工控自动化 2019年8月9日 4:02
全部回复
-
Enum.GetNames
这句话的意思是获取枚举中所有的项
https://docs.microsoft.com/zh-cn/dotnet/api/system.enum.getnames?view=netframework-4.8
即获取Handshake这个枚举中所有的项
1. 编译枚举Handshake中所有的项,并输出每个项的名称
2. Enum.Parse 是将指定字符串转换位枚举类型,即将handshake这个字符串转换为枚举类型Handshake
https://docs.microsoft.com/en-us/dotnet/api/system.enum.parse?view=netframework-4.8#System_Enum_Parse_System_Type_System_String_System_Boolean_
ericzhou
- 已标记为答案 工控自动化 2019年8月9日 4:01
-
Hi,
根据Enum.GetNames(Type) Method的文档可以知道该方法的参数是一个“Type”类型。而typeof 运算符的作用就是用于获取某个类型的 System.Type 实例。
Regards,
Kyle
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.- 已编辑 Kyle Wang - MSFTMicrosoft contingent staff, Moderator 2019年8月9日 1:33
- 已标记为答案 工控自动化 2019年8月9日 4:02