- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Collections;
-
- namespace ConsoleApplication2
- {
- class Program
- {
- public enum CMD_ERROR_TYPE
- {
- //解释出错
- PARSE_ERROR = 1,
- //错误CMD
- BAD_CMD,
- }
-
-
- static void Main(string[] args)
- {
- string cmd = "5 FAIL 1\n";
- if (IsServRespFailCMD(cmd)) ;
-
- Console.ReadLine();
- }
-
- public static bool IsServRespFailCMD(string rcvedCMD)
- {
- Hashtable htFileCmd = new Hashtable();
- string stdFileCmd = string.Empty;
-
- foreach (int e in Enum.GetValues(typeof(CMD_ERROR_TYPE)))
- {
- stdFileCmd = string.Format("5 FAIL {0}\n", e);
- htFileCmd.Add(stdFileCmd, e);
- }
-
- if (htFileCmd.ContainsKey(rcvedCMD))
- return true;
-
- return false;
- }
- }
- }