C#开发
Tonyzhou2005
这个作者很懒,什么都没留下…
展开
-
字节转位运算
//index从0开始 //获取取第index位 public static int GetBit(byte b, int index) { return ((b & (1 0) ? 1: 0; }//将第index位设为1 public static byte SetBit(byte b, int index) { return (byte)(b | (1 //将第inde转载 2013-03-06 20:24:42 · 960 阅读 · 0 评论 -
System.Threading.Timer线程通讯
using System;using System.Threading;class TimerExample{ static void Main() { // Create an event to signal the timeout count threshold in the// timer callback. AutoResetEvent autoEven原创 2013-03-23 15:10:27 · 516 阅读 · 0 评论 -
C#位运算处理权限问题介绍
常用的位运算主要有与(&), 或(|)和非(~), 比如: 1 & 0 = 0, 1 | 0 = 1, ~1 = 0 在设计权限时, 我们可以把权限管理操作转换为C#位运算来处理. 第一步, 先建立一个枚举表示所有的权限管理操作:[Flags]public enum Permissions{ Insert = 1, Delete = 2, Updat转载 2013-04-16 19:09:19 · 562 阅读 · 0 评论