本文介绍了Base64String和十六进制之间的转换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在C ++ / CLI的项目中使用 ToBase64String 来给像一个字符串 / MnwRx7kRZEQBxLZEkXndA == 我要将此字符串转换为十六进制再presentation,我该怎么做,在C ++ / CLI或C#?
I use in my C++/CLI project ToBase64String to give a string like /MnwRx7kRZEQBxLZEkXndA== I want to convert this string to Hexadecimal representation, How I can do that in C++/CLI or C#?
推荐答案FromBase64String将采取字符串到字节取值
byte[] bytes = Convert.FromBase64String(string s);
然后, BitConverter.ToString()将一个字节数组到十六进制字符串(的 C#字节[]以十六进制字符串)
Then, BitConverter.ToString() will convert a byte array to a hex string ( C# byte[] to hex string )
string hex = BitConverter.ToString(data);更多推荐
Base64String和十六进制之间的转换
发布评论