枚举操作大全
来源:互联网 发布:win7 网络打印机脱机 编辑:程序博客网 时间:2024/06/06 01:02
定义:
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace pub.Enums{ [Flags] public enum oriention { north = 1, south = 2, east = 4, west = 8 }}
后台代码:
oriention aa = oriention.north| oriention.east| oriention.west; Response.Write((oriention.north | oriention.east | oriention.west)+":" +Convert.ToInt32(aa) + "<br>"); if ((int)(aa & oriention.east)!=0) { Response.Write(oriention.east + "包含在aa里面<br>"); } if ((int)(aa & oriention.south) != 0) { Response.Write(oriention.south + "包含在aa里面<br>"); } Response.Write("3代表:"+(oriention)3+"<br>"); Response.Write("aa & oriention.east:" + (aa & oriention.east) + "<br>"); Response.Write("aa & oriention.south:" + (aa & oriention.south) + "<br>"); Response.Write("aa & oriention.east:" + (int)(aa & oriention.east) + "<br>"); Response.Write("aa & oriention.south:" + (int)(aa & oriention.south) + "<br>");
前台输出:
north, east, west:13
east包含在aa里面
3代表:north, south
aa & oriention.east:east
aa & oriention.south:0
aa & oriention.east:4
aa & oriention.south:0
0 0
- 枚举操作大全
- 枚举操作
- 枚举操作
- 枚举操作
- C#枚举使用示例大全
- c#枚举转化示例大全
- PCI设备操作--枚举
- 枚举的操作续
- C# 枚举转换操作
- ios 枚举 位移操作
- 枚举类型操作实例
- 关于枚举的操作
- 枚举移位操作
- c#枚举转化示例大全,数字或字符串转枚举
- C#枚举转化示例大全,数字或字符串转枚举
- c#枚举转化示例大全,数字或字符串转枚举
- 随心所欲操作Enum枚举类型
- 枚举(enum)的常用操作
- Mac上添加自己/公司的网络服务器盘
- 219. Contains Duplicate II
- Go语言学习之bufio包(The way to go)
- STL之deque容器的剖析
- JAVA程序设计_图谱
- 枚举操作大全
- MATLAB插值函数interp1
- AngularJS学习总结系列(二)
- docker registry http api v2
- 165. Compare Version Numbers
- SSM框架——详细整合教程(Spring+SpringMVC+MyBatis)
- 处理老大的老大的老大的老大反馈的问题, 发布后居然意外不生效???
- 环境变量的设置
- NYOJ 247 虚拟的城市之旅