小见

c#枚举定义,.net 枚举

电脑版发表于:2020/5/21 20:03

直接贴代码:

 public enum MessageType
 {
      FocusMsg = 1,
      CommentsMsg = 2,
      ResourceMsg = 3,
 }

可以这样写点注释

    public enum ResultCode
    {
        /// <summary>
        /// 成功
        /// </summary>
        SUCCESS = 10000,
        /// <summary>
        /// 失败
        /// </summary>
        FAILED = 10001,
        //参数验证失败
        VALIDATE_FAILED = 10002,
        /// <summary>
        /// 未知错误
        /// </summary>
        ERROR = 10003
    }


关于TNBLOG
TNBLOG,技术分享。技术交流:群号677373950
ICP备案 :渝ICP备18016597号-1
App store Android
精彩评论
{{item.replyName}}
{{item.content}}
{{item.time}}
{{subpj.replyName}}
@{{subpj.beReplyName}}{{subpj.content}}
{{subpj.time}}
猜你喜欢