一万光年外  
免费OA软件网 http://www.freeoasoft.com 专注于平台架构设计及OA软件开发
  // 字节转十六进制
  private static char[] hexDigits = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
  internal static string ToHexString(byte[] bytes)
  {
            char[] chars = new char[bytes.Length * 2];
            for (int i = 0; i < bytes.Length; i++)
            {
                int b = bytes[i];
                chars[i * 2] = hexDigits[b >> 4];
                chars[i * 2 + 1] = hexDigits[b & 0xF];
            }
            return new string(chars);
   }
posted on 2007-03-14 12:04  一万光年外  阅读(4022)  评论(1编辑  收藏  举报
 
免费OA软件网 http://www.freeoasoft.com 专注于平台架构设计及OA软件开发