日期:2014-05-17 浏览次数:20504 次
public static string GetHex(string str)
{
var bt = Encoding.BigEndianUnicode.GetBytes(str);
var hex = (from b in bt
let x = Convert.ToString(b, 16).ToUpper()
let y = x.Length < 2 ? "0" + x : x
select y).ToArray();
return string.Join(string.Empty, hex);
}