我有这个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)
我怎样才能做到这一点?