// 定义枚举类型
enum sotype : int { book=1, pen=2, other=3 } // 输出名称 switch (Enum.GetName(typeof(sotype), 1)) { case "book": string strbook = "book"; //此时这个将被执行 break; default: break; }

 

相关文章:

  • 2022-12-23
  • 2021-12-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-24
  • 2021-07-22
  • 2022-12-23
猜你喜欢
  • 2022-03-05
  • 2022-12-23
  • 2022-12-23
  • 2021-09-29
  • 2021-10-19
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案