小编Ale*_*een的帖子

将If语句转换为Switch

我有这个If语句,我想将它们转移到Case-Switch

这是我的if Stataments:

if (rResponse.ErrorCode[0] == 0x20 && rResponse.ErrorCode[1] == 0x03)
    ErrorMsg = "COMM_FRAME_ERROR";
if (rResponse.ErrorCode[0] == 0x20 && rResponse.ErrorCode[1] == 0x04)
    ErrorMsg = "JAM";
if (rResponse.ErrorCode[0] == 0x20 && rResponse.ErrorCode[1] == 0x05)
    ErrorMsg = "NO_CARD";
Run Code Online (Sandbox Code Playgroud)

我怎样才能做到这一点?

c# if-statement switch-statement

3
推荐指数
1
解决办法
747
查看次数

标签 统计

c# ×1

if-statement ×1

switch-statement ×1