Chinaunix首页 | 论坛 | 博客
  • 博客访问: 12433176
  • 博文数量: 1293
  • 博客积分: 13501
  • 博客等级: 上将
  • 技术积分: 17974
  • 用 户 组: 普通用户
  • 注册时间: 2011-03-08 18:11
文章分类

全部博文(1293)

文章存档

2019年(1)

2018年(1)

2016年(118)

2015年(257)

2014年(128)

2013年(222)

2012年(229)

2011年(337)

分类: C#/.net

2016-08-20 17:14:32


  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Collections;

  6. namespace ConsoleApplication2
  7. {
  8.     class Program
  9.     {
  10.         public enum CMD_ERROR_TYPE
  11.         {
  12.             //解释出错
  13.             PARSE_ERROR = 1,
  14.             //错误CMD
  15.             BAD_CMD,
  16.         }


  17.         static void Main(string[] args)
  18.         {
  19.             string cmd = "5 FAIL 1\n";
  20.             if (IsServRespFailCMD(cmd)) ;

  21.             Console.ReadLine();
  22.         }

  23.         public static bool IsServRespFailCMD(string rcvedCMD)
  24.         {
  25.             Hashtable htFileCmd = new Hashtable();
  26.             string stdFileCmd = string.Empty;

  27.             foreach (int e in Enum.GetValues(typeof(CMD_ERROR_TYPE)))
  28.             {
  29.                 stdFileCmd = string.Format("5 FAIL {0}\n", e);
  30.                 htFileCmd.Add(stdFileCmd, e);
  31.             }

  32.             if (htFileCmd.ContainsKey(rcvedCMD))
  33.                 return true;

  34.             return false;
  35.         }
  36.     }
  37. }

阅读(9200) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~