字节数组转16进制输出

来源:互联网 发布:淘宝我的五星好评截图 编辑:程序博客网 时间:2024/06/07 17:51
 #region 字节数组转16进制字符串
        /// <summary>
        /// 字节数组转16进制字符串
        /// </summary>
        /// <param name="bytes"></param>
        /// <returns></returns>
        public string byteToHexStr(byte[] bytes)
        {
            string StringOut = "";
            foreach (byte InByte in bytes)
            {
                StringOut = StringOut + String.Format("{0:X2} ", InByte);
            }
            StringOut = StringOut + "\n";
            return StringOut;
        }
        #endregion
原创粉丝点击