.net &位运算符的应用

 public string GetPopedAction(int PopedAction)
        {
            string str = "";
            if (PopedAction == 0)
            {
                str += "无需特殊处理,";
            }
            if ((PopedAction & 1) == 1)
            {
                str += "已删除,";
            }
            if ((PopedAction & 2) == 2)
            {
                str += "已转入客服,";
            }
            if ((PopedAction & 4) == 4)
            {
                str += "已回复,";
            }
            if ((PopedAction & 8) == 8)
            {
                str += "已审核,";
            }
            if (str.Length > 0)
            {
                str = str.Substring(0, str.Length - 1);
            }
            return str;

        }

  

posted @ 2013-12-25 15:41  名字随意  阅读(206)  评论(0编辑  收藏  举报