C# 16进制转换为Base64字符串

来源:互联网 发布:视频文件旋转角度软件 编辑:程序博客网 时间:2024/06/05 19:45
                                MatchCollection mc = Regex.Matches(retrunValue.ToString(), "[A-F0-9]{2}");                                byte[] bytes = new byte[mc.Count];                                for (int i = 0; i < mc.Count; i++)                                {                                    bytes[i] = byte.Parse(mc[i].Value, System.Globalization.NumberStyles.HexNumber);                                }                                                                retrunValue = Convert.ToBase64String(bytes);

0 0
原创粉丝点击